How to get shell screen out from python?

Changsen Xu cxu1 at nd.edu
Wed Jan 24 21:05:28 EST 2001


Hi,

Now I wish to get the output from running a shell command, I
can't find an easy way in python but use pipe:
    p=popen('lp *.ps'); t=p.read(); p.close()

while in tcsh, it may just be:
    set t =  `lp *.ps`

Any of you can teach me an easier way in python ?

Thanks,




More information about the Python-list mailing list