We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cd3f59 commit 4174ebbCopy full SHA for 4174ebb
raffle.py
@@ -1,10 +1,14 @@
1
import csv
2
import random
3
-import sys
+import argparse
4
from random import shuffle
5
-totalWinners = 48
+parser = argparse.ArgumentParser()
6
+parser.add_argument("csv",help = "the location of the csv input")
7
+args = parser.parse_args()
8
winlist = []
-with open(sys.argv[1]) as csvfile:
9
+csvrow = open(args.csv)
10
+totalWinners = sum(1 for row in csvrow)
11
+with open(args.csv) as csvfile:
12
reader = csv.DictReader(csvfile)
13
for row in reader:
14
username = row['What username do you go by online?']
0 commit comments