Rhett's approach is clean, I like it...this is just additional info, a little late, but here it is--- basically, a None type obj is returned by python...You can access a csv with an arcpy search cursor as shown below, possibly with the 'data access' search cursor (arcpy.da.searchcursor). The below is a simple demo from 10.0 (da is new at 10.1).This is my 'junk' csv file contents, set up just for this demo:
field0,field1,field2,field3
1254,text,1258,562
,,,
, , ,
99.99,, 515, 621
5424,mytext,2301.123,562
...and this is the simple code (entered from IDLE) showing cursor access (just printing to the screen):
>>> import arcpy
>>> arcpy.env.workspace = r'C:\Documents and Settings\whitley-wayne\Desktop'
>>> CSV = 'testCSV1.csv'
>>> fields = arcpy.ListFields(CSV)
>>> rows = arcpy.SearchCursor(CSV)
>>> lineTXT = ''
>>> for row in rows:
for fieldObj in fields:
lineTXT += '\'' + str(row.getValue(fieldObj.name))+ '\'\t'
print lineTXT
lineTXT = ''
'1254.0' 'text' '1258.0' '562'
'None' 'None' 'None' 'None'
'None' 'None' 'None' 'None'
'99.99' 'None' '515.0' '621'
'5424.0' 'mytext' '2301.123' '562'
>>>
Anyway, that was short and sweet - maybe that'll help in getting started with cursors...And by the way, the analogous test for Null in Python simply use the keyword None (no quotes), i.e., in an 'if' statement:
if row.getValue(field) is None:
# then do something, for example...
myFlag = True
Enjoy,Wayne