Reputation:
I attached the python script above.
I am trying to print out the information I need in to a csv. Whenever I attempt this, I get a TypeError: 'newline' is an invalid keyword argument for this function'. I am very new to python so I'm not sure how to address this (or if there are other issues in the script).
#print(teams)
with open('players.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile, delimiter=',',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
for row in teams:
writer.writerow(row)
Upvotes: 0
Views: 33
Reputation: 177675
In Python 2, use 'wb'
instead of newline=''
to achieve the same effect. Python 3 uses the latter.
Upvotes: 1