Skip to content

Commit 579437b

Browse files
committed
added number of winners as argument
1 parent 4174ebb commit 579437b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

raffle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
from random import shuffle
55
parser = argparse.ArgumentParser()
66
parser.add_argument("csv",help = "the location of the csv input")
7+
parser.add_argument("totalWinners", type=int, help="total number of selected winners")
78
args = parser.parse_args()
89
winlist = []
910
csvrow = open(args.csv)
10-
totalWinners = sum(1 for row in csvrow)
11+
totalWinners = args.totalWinners
1112
with open(args.csv) as csvfile:
1213
reader = csv.DictReader(csvfile)
1314
for row in reader:

0 commit comments

Comments
 (0)