Re: TypeNone field detection

2008-04-19 Thread Joe Blow
On Wed, 16 Apr 2008 21:13:18 -0400, Steve Holden wrote: > > Since there is only one instance of TypeNone (the value we reference as > None) the easiest test is > >if x is None: > Thanks... the "if x is None:" statement is exactly what I was looking for. -- http://mail.python.org/mailman/l

TypeNone field detection

2008-04-16 Thread Joe Blow
What is the best way to detect a TypeNone field in a tuple, or in a list? I am accessing a MySQL database using the MySQLdb Python interface... this interface returns a tuple object type in response to SQL SELECT statements. My understanding of the MySQLdb interface is that NULL database values a

Pythonic tee for subprocess module.

2007-11-13 Thread Joe Blow
I'd like to use the subprocess module to create a pipeline with a fork. For example, what if I wanted a "cat" process to send a file to both an "md5sum" process and a "gzip" process. In bash, I'd do something like this: > cat source_file | tee >(md5sum > source_file.md5sum) | gzip -c > > source