combining commands:

Edw88253 none at dev.null
Mon May 28 23:49:54 EDT 2001

<kasper37 at> wrote in message
news:a258a558.0105281449.782cfc33 at
> is there any way to combine these three commands into 1 line?
> c.execute( "SELECT COUNT(*) from CONCENTRIC" )
> temp = c.fetchone()
> print( temp[0] )

>>> (c.execute("..."), sys.stdout.write(c.fetchone()[0]+'\n')) and None

(the "and None" is to give you the same return value; the sys.stdout.write()
isn't exactly equivalant to print(), but it's close enough..)

Note that if you use code this ugly, you will have to be shot.


More information about the Python-list mailing list