html - How do you input 2 files then output them in python? -
i have code written webpage , need know how take 2 data files , import them array output data in table on html site.
the 2 data files txt files on computer
well i'm going take guess want create html table has 1 line per data line in text file.
file1=open("input1.txt",'ru') file2=open("input2.txt",'ru') lines = file1.readlines() + file2.readlines() html = "<html>\n<body>\n<table>" line in lines: html += "<tr><td>" + line + "</td></tr>\n" html += "</table>\n</body>\n</html>" output = open('output_file.html','w') output.write(html)
i don't know if looking for, said above.
Comments
Post a Comment