change a value to NULL?

Bell, Kevin kevin.bell at slcgov.com
Wed Oct 5 11:37:31 EDT 2005


I'm pulling a list of numbers from MS Excel, but occasionally if there
is no data from excel, the value is an asterisk, but I need to make it
null.  

What is the best way to do that?  Thus far, I'm using:


for value in myRange:
       try:
           intV = int(value)
           print intV
       except:
           print "its an asterisk" 


but I need to get at my list and substitute the *'s with nulls to load
into a database.

Thanks.

Kevin Bell




More information about the Python-list mailing list