File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import csv
2
+ import random
3
+ import sys
4
+ from random import shuffle
5
+ winlist = []
6
+ with open (sys .argv [1 ]) as csvfile :
7
+ reader = csv .DictReader (csvfile )
8
+ for row in reader :
9
+ username = row ['What username do you go by online?' ]
10
+ if row ['What username do you go by online?' ] == '-' :
11
+ username = row ['Ticket First Name' ]
12
+ winlist .append (row ['Number' ] + " " + username )
13
+ [print (thing ) for thing in random .sample (winlist , len (winlist ))[0 :30 ]]
14
+ slide = open ('slide.html' ,'w' )
15
+ slide .write ("""
16
+ <!DOCTYPE html>
17
+ <html>
18
+ <head>
19
+ <meta charset="UTF-8">
20
+ <title>SMK Winter Meetup 2018 Winners!</title>
21
+ <h1>And the winners are...</h1>
22
+ </head>
23
+ <body>
24
+ """ )
25
+ for i in random .sample (winlist , len (winlist ))[0 :30 ]:
26
+ slide .write ("<p>" + i + "</p>\n " )
27
+ slide .write ("""
28
+ </body>
29
+ </html>
30
+ """ )
31
+ slide .close ()
You can’t perform that action at this time.
0 commit comments