Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write to CSV
#2
Wall file, list are Python function names - please, don't overshadow those with your variables.
Every second post here - me think  Angry - is about iterating over lists directly.
If you want to create a string with comma-separated list elements, use join method
','.join(data)
PS You didn't close bracket in line 3 - and you are supposed to close line with EOL - you write it outside the outermost loop, thus not separating rows
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
Write to CSV - by arsenal88 - Apr-25-2017, 08:10 PM
RE: Write to CSV - by volcano63 - Apr-25-2017, 09:30 PM
RE: Write to CSV - by wavic - Apr-26-2017, 12:02 AM
RE: Write to CSV - by sparkz_alot - Apr-26-2017, 01:52 PM
RE: Write to CSV - by snippsat - Apr-26-2017, 02:03 PM
RE: Write to CSV - by sparkz_alot - Apr-26-2017, 02:23 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020