Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have the following HTML code, and I need to fill each nametag with CSV data from pythong. Also, A loop will be needed to
I have the following HTML code, and I need to fill each nametag with CSV data from pythong. Also, A loop will be needed to write out the divs in the HTML file. I have parsed the CSV so far, I need help creating a loop to fill the HTML nametag form with the respected: Name, Title, School, City, Stat. Any help would be appreciated.
html> <html> <head> <meta charset="UTF-8"> <title>nametags8title> <link rel="stylesheet" type="text/css" href="../css/nametags8.css"> head> <div class="body"> <body> <div id ="header"> <header> <blockquote> <h1 id="header-h1"> Hello <b>Adminb>. This is the nametag form: 8 per page. h1> blockquote> header> div> <div id="sheet-for-8"> <div id="left-box-1"> <p id="b1lFN"><b>Jillb>p> <p id="b1lLN">Smithp> <p id="b1lT"><b>Web Developerb>p> <p id="b1lSch">Tulane Universityp> <p id="b1lFrom">New Oreleans, LAp> div> <div id="right-box-1"> <p id="b1rFN"><b>Jillb>p> <p id="b1rLN">Smithp> <p id="b1rT"><b>Web Developerb>p> <p id="b1rSch">Tulane Universityp> <p id="b1rFrom">New Orleans, LAp> div> <div id="left-box-2"> <p id="b2lFN"><b>Jillb>p> <p id="b2lLN">Smithp> <p id="b2lT"><b>Web Developerb>p> <p id="b2lSch">Tulane Universityp> <p id="b2lFrom">New Orleans, LAp> div> <div id="right-box-2"> <p id="b2rFN"><b>Jillb>p> <p id="b2rLN">Smithp> <p id="b2rT"><b>Web Developerb>p> <p id="b2rSch">Tulane Universityp> <p id="b2rFrom">New Orleans, LAp> div> <div id="left-box-3"> <p id="b3lFN"><b>Jillb>p> <p id="b3lLN">Smithp> <p id="b3lT"><b>Web Developerb>p> <p id="b3lSch">Tulane Universityp> <p id="b3lFrom">New Orleans, LAp> div> <div id="right-box-3"> <p id="b3rFN"><b>Jillb>p> <p id="b3rLN">Smithp> <p id="b3rT"><b>Web Developerb>p> <p id="b3rSch">Tulane Universityp> <p id="b3rFrom">New Orleans, LAp> div> <div id="left-box-4"> <p id="b4lFN"><b>Jillb>p> <p id="b4lLN">Smithp> <p id="b4lT"><b>Web Developerb>p> <p id="b4lSch">Tulane Universityp> <p id="b4lFrom">New Orleans, LAp> div> <div id="right-box-4"> <p id="b4rFN"><b>Jillb>p> <p id="b4rLN">Smithp> <p id="b4rT"><b>Web Developerb>p> <p id="b4rSch">Tulane Universityp> <p id="b4rFrom">New Orleans, LAp> div> div> body> div> html>
//python code
import csv stateOf = [] html_output = '' with open("fileFor.csv", "rU") as csv_file: myFile = csv.reader(csv_file) for line in myFile: names = {line[2]} titleOf = {line[12]} schOf = {line[13]} cityOf = {line[6]} stateOf.append(f'{line[6]} {line[7]}') for state in stateOf: print(state)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started