Help me with this code PLEASE

John Gordon gordon at panix.com
Tue Nov 5 17:54:41 EST 2013


In <l5brem$trk$1 at dont-email.me> Nick the Gr33k <nikos.gr33k at gmail.com> writes:

> The code i provided only worked once before it failed and managed to 
> store this:
> 	
> counterID,host,refs,city,userOS,browser,visits,hits,download
> -------------------------------------------------------------
> 1, 176-92-96-218.adsl.cyta.gr, Europe/Athens, Windows, Chrome, 
> 0000-00-00 00:00:00, 1, ''

You've got a data inconsistancy here.  You give nine column names, but
only eight values.  It's impossible to tell which value belongs to which
column.  Which value is missing?

> 'visit's column is full of zeroes. Perhaps this is considered  as Null 
> for Python?

Python does not consider zero to be a null value.  (It will compare as
equal to False, but that's not the same.)

> But ref is also null, why the code didn't complain for 'ref' which is 
> retrieved just before 'visits'?

Are you sure refs is null?  According to the sample values you gave, refs
is 'Europe/Athens'.

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gordon at panix.com    watch 'House', or a real serial killer to watch 'Dexter'.




More information about the Python-list mailing list