capturing stderr && stdout

Gerrit Holl gerrit.holl at pobox.com
Tue Nov 2 22:44:36 CET 1999


Agent Drek wrote:
> Hullo,

Hyllo,

> p = os.popen("%s" % HSCRIPT, "w")
> p.write("opcd /obj\n")
> p.write("opadd geo\n")
> p.write("opls\n")
> p.write("quit\n")

Hmm, I recommend replacing this with:
p.writeline("opcd /obj")
p.writeline("...")
...etc...

or:
p.write("""opcd /obj
opass geo
opls
quit""")

or:
STRING = """opcd /obj
opass geo
opls
quit"""

p.write(STRING)

regards,
Gerrit.




More information about the Python-list mailing list