Rigga wrote: > 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' If your problem is getting a python string without worrying about how to escape the escape sequences, try:
r"""wget -q www.anywebpage.com -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p'""" You should be able to pass this directly to a popen() function. -- http://mail.python.org/mailman/listinfo/python-list