import pandas as pd
titleDF = pd.read_csv("title.csv")
linksDF = pd.read_csv("links.csv")
html = open("index.html", "w")
html.write("\n\n
\n\tYour Links\n\t\n\t\n\t\n\n\n")
html.write(f"\n\t{titleDF['description'][0]}
\n
\n")
for i,x in linksDF.iterrows():
html.write(f"\n\n\t
\n\t
\n")
html.write("\t\n\n")
html.close()
script = open("script.js", "w")
script.write("class link{\n\tconstructor(url){\n\t\tthis.url= url;\n\t}\n\tshow(){\n\t\tvar win=window.open(this.url, '_blank');\n\t\twin.focus();\n\t}\n}")
for i,x in linksDF.iterrows():
script.write(f"var {x['name'].replace(' ','').lower()} = new link('{x['link']}')\n")
script.close()