Python Forum
importing CSV file into a HTML table using Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing CSV file into a HTML table using Python
#2
Probably, you forgot something like this:

print("<tr>")
print("\n".join("<td>%s</td>" % v for v in row))
print("</tr>")
instead of lines 30-42.

However, I would strongly recommend to look (and use it) at some template engine (e.g. jinja2), if you want
to generate html/xml/text etc. formatted documents.
Reply


Messages In This Thread
RE: importing CSV file into a HTML table using Python - by scidam - Feb-22-2020, 09:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Going through HTML table with selenium emont 3 854 Sep-30-2023, 02:13 AM
Last Post: emont
  Need to replace a string with a file (HTML file) tester_V 1 800 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  Tkinterweb (Browser Module) Appending/Adding Additional HTML to a HTML Table Row AaronCatolico1 0 969 Dec-25-2022, 06:28 PM
Last Post: AaronCatolico1
  New2Python: Help with Importing/Mapping Image Src to Image Code in File CluelessITguy 0 743 Nov-17-2022, 04:46 PM
Last Post: CluelessITguy
  python standard way of importing library mg24 1 942 Nov-15-2022, 01:41 AM
Last Post: deanhystad
  Use module docx to get text from a file with a table Pedroski55 8 6,356 Aug-30-2022, 10:52 PM
Last Post: Pedroski55
  Problem with importing Python file in Visual Studio Code DXav 7 5,264 Jun-15-2022, 12:54 PM
Last Post: snippsat
  importing functions from a separate python file in a separate directory Scordomaniac 3 1,416 May-17-2022, 07:49 AM
Last Post: Pedroski55
  HTML file crashes program mikefirth 12 3,959 Dec-31-2021, 03:57 AM
Last Post: Pedroski55
  Importing a function from another file runs the old lines also dedesssse 6 2,622 Jul-06-2021, 07:04 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020