So I've just started playing around with python. My first script was to spool through a pipe deliminated csv.
I noticed this language is slightly more strict than PHPI receive an error when trying to assign a non existant variable to a new list.
Code Python:#open csv file ifile = open('/tmp/file.dat', "rb") reader = csv.reader(ifile,delimiter='|') for row in reader: op = { 'column': row[4] }
If row[4] happens to be null for that row, then it will error out. I've come across a few solutions such as setdefault. But I'm curious how some of your setups might be, especially for something dynamic like spooling a csv.




I receive an error when trying to assign a non existant variable to a new list.
Reply With Quote



Bookmarks