Need help running external program

Rigga rigga at hasnomail.com
Sun Feb 27 12:02:00 EST 2005


Hi,

I am running the line of code below from a shell script and it works fine,
however I am at a total loss on how i can run it from within a Python
script as every option I have tried fails and it appears to be down to the
escaping of certain characters.

wget -q www.anywebpage.com -O - | tr '\r' '\n' | tr \' \" | sed -n
's/.*url="\([^"]*\)".*/\1/p'

I want to use the above code in my program by using popen2 so i can query
the results i.e.

output, input = popen2("the code here")

print output

Any help would be appreciated.

Many thanks

RiGGa







More information about the Python-list mailing list