This code prints the first two rows of a csv file:
with open('myfile.csv', 'r') as f:
for n, l in enumerate(f):
if n > 1:
break
print l
How do I integrate the code above to the code below? (I am looking to sendPackage for two rows)
with open(sys.argv[1]) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
sendPackage(row, job_id)