Re: generator expression works in shell, NameError in script

2009-06-29 Thread alito
On Jun 18, 11:56 pm, nn wrote: > On Jun 18, 8:38 am, guthrie wrote: > > > > > On Jun 17, 6:38 pm, Steven Samuel Cole > > wrote: > > > > Still don't really understand why my initial code didn't work, though... > > > Your code certainly looks reasonable, and looks to me like it "should" > > work.

Re: psycopg2 and large queries

2008-12-18 Thread alito
On Dec 19, 2:34 am, Laszlo Nagy wrote: > > I was looking for psycopg2 documentation, but I found nothing. However, > I found some posts telling that named cursors do support fetching a > single row at a time. Here is how to create a named cursor: > > cur = conn.cursor('mycursor') > > This is very

Usual practice: running/testing modules in a package

2008-08-13 Thread alito
Hi all, I am new to using packages to group my modules. I can't figure out how to run a module that uses relative imports without writing a wrapper that imports that module. Everything I try it complains that I am attempting a relative import in a non-package. eg ~/python/testpackage$ ls config

Re: how to use subprocess.Popen execute "find" in windows

2008-05-06 Thread alito
On May 6, 7:19 pm, [EMAIL PROTECTED] wrote: > In cmd, I can use find like this. > > C:\>netstat -an | find "445" >   TCP    0.0.0.0:445            0.0.0.0:0              LISTENING >   UDP    0.0.0.0:445            *:* > > C:\> > > And os.system is OK.>>> import os > >>> os.system('netstat -an | fin