change a value to NULL?
steve at holdenweb.com
Wed Oct 5 18:35:05 CEST 2005
Brett Hoerner wrote:
> I'm not sure what you mean, really, do you need an official Python
> "Null" value? Try None?
> In : myCells = ['Mary', 'Bob', None, 'Joe']
> In : for cell in myCells:
> ...: if cell:
> ...: print cell
> ...: else:
> ...: print "NULL VALUE"
> NULL VALUE
> As far as having a Null value to put into the DB, most (SQL) DB's I've
> used have a specific SQL command like "INSERT INTO ROW VALUE NULL()",
> kind of like the SQL DATE(), etc. I'm really rusty on my syntax etc
> right now btw so don't copy and paste that. :P
And besides that, Excel is a spreadsheet not a database :-)
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
More information about the Python-list