I am writing a htmlfunction in python as below:
def html(function):
htmlfile = open(function.name+".html", "w")
htmlfile.write("<html>\n")
# statement for title
# statement for header
htmlfile.write('<img src = '+function.name+'.png alt ="cfg">\n')
htmlfile.write("</html>\n")
htmlfile.close()
earlier I had files in the same directory where I am running my script. Now I have created a folder images for it and all moved files to this folder. function.name+ pulls up different functions name
how to change img src line? when I substitute images/'function.name+', the image doesn't get inserted to HTML.
All images have name in the format
<name of the function>.png
srcattribute.'<img src = "{}.png" alt = "cfg">\n'.format(function.name)htmlfile.write('<img src = "' + image_path + '" alt ="cfg">\n')