Created
July 16, 2011 05:32
-
-
Save yurenju/1086042 to your computer and use it in GitHub Desktop.
generate html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
csv = open('coscup.csv') | |
html = open('album.html', 'w') | |
style = 'width:600px;margin-bottom:50px;'; | |
style += 'margin-left:auto;margin-right:auto;' | |
style += 'border: 1px solid #AAA;padding:10px;' | |
style += '-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);' | |
for line in csv.readlines(): | |
if 'Timestamp' in line: | |
continue | |
arr = [n.strip() for n in line.split(',')] | |
html.write('<div style="%s">' % style); | |
html.write('<img src="%s" width="600px"/>' % arr[1]) | |
html.write('<div style="text-align:center">%s - %s</div>' % (arr[0], arr[2])) | |
html.write('</div>') | |
csv.close() | |
html.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment