How to pass a multiline arg to exec('some.exe arg')?

n00m n00m at narod.ru
Mon May 5 10:58:26 EDT 2008


it can be done like this:

            osql=popen2.popen2('osql -E -S(local) -dpubs -c"GO" -n -
w800')
            osql[1].write(query+'\nGO\n')
            osql[1].close()
            res=osql[0].readlines()
            osql[0].close()
            res=join(res,'')

btw, is it necessarily to close() osql[1] in order to get res?
without close() the script seems is waiting for smth.
I'd like to get "res" in a loop:
write()
read()
write()
read()
...
is it possible?



More information about the Python-list mailing list