I'm writing an python script which generates html reports. So far OK. Now I'm on a point where I would like to have variable names of a file within a link. This means i have a directory with files of following names:
LOG_file1.txt
LOG_file2.txt
LOG_file3.txt
LOG_file4.txt
LOG_file5.txt
As you can see, the file names begins with "LOG_" and ends with ".txt"
Now I would like to build a link depending on the needed file. For example if I have a variable "filename" in my python script (which is defined earlier) where the name of the file is stored (file1, file2, file3...). At the end would like to have something like this:
<a href="this/is/the/path/to/my/LOG_filename.txt">My Link</a>
where "filename" is one of the files listed below. I have tried this:
'<a href="this/is/the/path/to/my/LOG_'+filename'+'.txt'\"> My Link </a>'
Have also to mention that i'm relatively new to python.