Re: problem with appending to a list, possibly mysqldb related



On Thu, 31 Aug 2006 18:39:45 GMT
John Salerno <johnjsal@xxxxxxxxxxxxxxx> wrote:

John Salerno wrote:
John Purser wrote:

I'd say you had a record with a null value for the namefirst field.
The join method don't like that.

Wow, you're right! I tried this:

if x[0] and not x[0] == 'NULL':

and sure enough it works after that. (Not sure if that's the best
way to test, though. Just testing for NULL still produced the
error, so I guessed that some namefirst fields were actually blank.)

Just tried again with:

if x[0]:

and that worked, so I guess NULL isn't a string value.
--
http://mail.python.org/mailman/listinfo/python-list
Your original python error was telling you that .join() didn't like
receiving a 'NoneType'. Try entering type(None) from the python prompt.

By the time Python is seeing it it's not a MySQL null, it's a python
None.

--
You have a strong desire for a home and your family interests come
first.
.



Relevant Pages

  • Need better string methods
    ... scripting languages used in the electronics design industry. ... I am convinced that Python can do anything that can be done by these ... Then you can decide if you want to learn the full language. ... the join method *after* the following strip, ...
    (comp.lang.python)
  • RE: Need better string methods
    ... > I'm considering Python as a replacement for the highly specialized ... > leading to a clean syntax. ... > single string at its back door. ... > of the join method. ...
    (comp.lang.python)
  • Re: problem with appending to a list, possibly mysqldb related
    ... John Purser wrote: ... The join method don't like that. ... Your original python error was telling you that .joindidn't like ... Try entering typefrom the python prompt. ...
    (comp.lang.python)
  • Re: advice on this little script
    ... John Salerno wrote: ... package, never to import specific objects (functions, classes, or ... I'm hardly new to Python, yet it keeps helping me too;-). ... at this point, I'd _first_ check if they were imported modules, while it ...
    (comp.lang.python)
  • Re: simultaneous assignment
    ... John Salerno a écrit: ... Basically I'm reading this book to give me little things to try out in Python. ... Rebinding a name already bound to a given object doesn't affect other names bound to the same object. ...
    (comp.lang.python)