Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ll21215/apt_exercises
  • hb09106/apt_exercises
  • afischer/apt_exercises
  • sm27496/apt2020
  • ia19390/apt_exercises
  • pk02862/apt_exercises
  • cd28198/apt_exercises
  • ma05240/apt_exercises
  • jp01114/apt_exercises
  • mf19908/apt_exercises
  • an25923/apt_exercises
  • ma18960/apt_exercises
  • fa30968/apt_exercises
  • jg08184/apt_exercises
  • gs27324/apt_exercises
  • ss18986/apt_exercises
16 results
Show changes
Commits on Source (1)
...@@ -20,8 +20,10 @@ def read_csv(filename): ...@@ -20,8 +20,10 @@ def read_csv(filename):
result = [] result = []
with open(filename) as csvfile: with open(filename) as csvfile:
### EDIT BELOW HERE ### ### EDIT BELOW HERE ###
row=[]
reader = csv.reader(csvfile, delimiter=";") reader = csv.reader(csvfile, delimiter=";")
pass for row in reader:
result.append(row)
### EDIT ABOVE HERE ### ### EDIT ABOVE HERE ###
return result return result
...@@ -38,10 +40,11 @@ def csv_to_html(csvdata): ...@@ -38,10 +40,11 @@ def csv_to_html(csvdata):
""" """
htmlstring = "" htmlstring = ""
### EDIT BELOW HERE ### ### EDIT BELOW HERE ###
htmlline = "<tr><td>{}</td><td>{}</td><td>{}</td></tr>\n" big_list=read_csv('test.csv')
pass for row in big_list:
htmlline = "<tr><td>{}</td><td>{}</td><td>{}</td></tr>\n"
htmlstring=htmlstring+htmlline
### EDIT ABOVE HERE ### ### EDIT ABOVE HERE ###
return htmlstring return htmlstring
...@@ -51,7 +54,13 @@ def combine_template_with_data(template_string, htmldata): ...@@ -51,7 +54,13 @@ def combine_template_with_data(template_string, htmldata):
tabular data. tabular data.
""" """
### EDIT BELOW HERE ### ### EDIT BELOW HERE ###
return "" fullstring=""
i= ""
i=csv_to_html('test.csv')
with open('template.html','r',encoding='utf-8') as f:
reader=f.read()
fullstring=reader.replace('{}',i)
return fullstring
### EDIT ABOVE HERE ### ### EDIT ABOVE HERE ###
......