Re: Question about StringIO

2005-10-11 Thread Frank Millman
Diez B. Roggisch wrote: > > My scripts are used to create the tables in the database. I didn't > > think that DB-API covered that. > > The DB-Api covers executin arbirary SQL - either DDL or DML. It is > surely centered around DML, but that doesn't mean that its not usabel to > issue "create ..."

Re: Question about StringIO

2005-10-11 Thread Frank Millman
Diez B. Roggisch wrote: > > Thanks for this pointer. I have read it, but I don't think it applies > > to my situation, as it talks about 'reading' from the child's stdout > > while the child is 'writing' to stderr. > > But that is exactly the point: the psql blocks because you don't read > away th

Re: Question about StringIO

2005-10-11 Thread Diez B. Roggisch
> My scripts are used to create the tables in the database. I didn't > think that DB-API covered that. The DB-Api covers executin arbirary SQL - either DDL or DML. It is surely centered around DML, but that doesn't mean that its not usabel to issue "create ..." statements. >However, even if i

Re: Question about StringIO

2005-10-11 Thread Diez B. Roggisch
> Thanks for this pointer. I have read it, but I don't think it applies > to my situation, as it talks about 'reading' from the child's stdout > while the child is 'writing' to stderr. But that is exactly the point: the psql blocks because you don't read away the buffered data. Start a thread, re

Re: Question about StringIO

2005-10-11 Thread Frank Millman
Diez B. Roggisch wrote: > > Thanks, Steve and Diez, for the replies. I didn't think it was > > possible, but it was worth asking :-) > > > > I will try to explain my experience with popen() briefly. > > > > I have some sql scripts to create tables, indexes, procedures, etc. At > > present there are

Re: Question about StringIO

2005-10-11 Thread Frank Millman
Benjamin Niemann wrote: > Frank Millman wrote: > > > I will try to explain my experience with popen() briefly. > > > > I run through all the scripts and create a StringIO object with the > > string I want to pass. It is about 250 000 bytes long. If I run psql > > using popen(), and pass it the stri

Re: Question about StringIO

2005-10-10 Thread Diez B. Roggisch
> Thanks, Steve and Diez, for the replies. I didn't think it was > possible, but it was worth asking :-) > > I will try to explain my experience with popen() briefly. > > I have some sql scripts to create tables, indexes, procedures, etc. At > present there are about 50 scripts, but this number w

Re: Question about StringIO

2005-10-10 Thread Benjamin Niemann
Frank Millman wrote: > I will try to explain my experience with popen() briefly. > > I have some sql scripts to create tables, indexes, procedures, etc. At > present there are about 50 scripts, but this number will grow. I have > been running them manually so far. Now I want to automate the proce

Re: Question about StringIO

2005-10-10 Thread Frank Millman
Diez B. Roggisch wrote: > Frank Millman wrote: > > Hi all > > > > I understand that StringIO creates a file-like object in memory. > > > > Is it possible to invoke another program, using os.system() or > > os.popen(), and use the < redirect operator, so that the other program > > reads my StringIO

Re: Question about StringIO

2005-10-09 Thread Diez B. Roggisch
Frank Millman wrote: > Hi all > > I understand that StringIO creates a file-like object in memory. > > Is it possible to invoke another program, using os.system() or > os.popen(), and use the < redirect operator, so that the other program > reads my StringIO object as its input? No. Processes do

Re: Question about StringIO

2005-10-09 Thread Steve Holden
Frank Millman wrote: > Hi all > > I understand that StringIO creates a file-like object in memory. > > Is it possible to invoke another program, using os.system() or > os.popen(), and use the < redirect operator, so that the other program > reads my StringIO object as its input? > > I will provi

Question about StringIO

2005-10-09 Thread Frank Millman
Hi all I understand that StringIO creates a file-like object in memory. Is it possible to invoke another program, using os.system() or os.popen(), and use the < redirect operator, so that the other program reads my StringIO object as its input? I will provide more details if required, but hopefu