Re: Need help running external program

2005-03-03 Thread Rigga
Thanks to all for your help it is now working, I rant he code through a debugger and found that the input file I was using to create my list of addresses to wget had newlines in them and were therefore breaking my command line. All your advice has been appreciated. RiGGa -- http://mail.python.o

Re: Need help running external program

2005-03-02 Thread Steve Holden
Rigga wrote: Tim Jarman wrote: Rigga wrote: Brian van den Broek wrote: Rigga said unto the world upon 2005-02-27 15:04: (snip stuff about raw strings) Thanks for all your help with this it is appreciated, one further question though, how do I pass a variable to the external program while using

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: (snip) >> > This is the command I am trying to run: > > feed is a list of web addresses > > output, input = popen2("wget -q %s -O - | tr '\r' '\n' | tr \' \" | sed -n > 's/.*url="\([^"]*\)".*/\1/p'" % feed[counter]) > > But it does not work, if I escape the string using r""" and

Re: Need help running external program

2005-03-02 Thread Rigga
Tim Jarman wrote: > Rigga wrote: > >> Brian van den Broek wrote: >> >>> Rigga said unto the world upon 2005-02-27 15:04: > > (snip stuff about raw strings) > >> Thanks for all your help with this it is appreciated, one further >> question though, how do I pass a variable to the external progra

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: > Brian van den Broek wrote: > >> Rigga said unto the world upon 2005-02-27 15:04: (snip stuff about raw strings) > Thanks for all your help with this it is appreciated, one further question > though, how do I pass a variable to the external program while using the > r""" > > Than

Re: Need help running external program

2005-03-02 Thread Rigga
Brian van den Broek wrote: > Rigga said unto the world upon 2005-02-27 15:04: >> Tim Jarman wrote: > > > >>>No, the r was the point - it's there to tell Python not to do any >>>escaping on the string. Try it again with the r and see what happens. >>> >> >> Brilliant!!! that works a treat than

Re: Need help running external program

2005-02-27 Thread Pink
Rigga wrote: >> No, the r was the point - it's there to tell Python not to do any >> escaping on the string. Try it again with the r and see what happens. >> > Brilliant!!! that works a treat thankyou!!, where on earth did you find > out > about the 'r' any pointers to documentation appreciated.

Re: Need help running external program

2005-02-27 Thread Brian van den Broek
Rigga said unto the world upon 2005-02-27 15:04: Tim Jarman wrote: No, the r was the point - it's there to tell Python not to do any escaping on the string. Try it again with the r and see what happens. Brilliant!!! that works a treat thankyou!!, where on earth did you find out about the 'r' any

Re: Need help running external program

2005-02-27 Thread Rigga
Tim Jarman wrote: > Rigga wrote: > >> Pink wrote: >> >>> 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

Re: Need help running external program

2005-02-27 Thread Tim Jarman
Rigga wrote: > Pink wrote: > >> 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

Re: Need help running external program

2005-02-27 Thread Leif B. Kristensen
I'm using wget from Python to get extactly one line from a reports page. I made this function that works for me: def wgetline(exp): # see Python Cookbook p. 228 print "Getting result from server ..." command = 'wget -q -O - \ http://www.foobar.com/report.pl\?UserID=xxx\&UserPW=xxx

Re: Need help running external program

2005-02-27 Thread Rigga
Pink wrote: > 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 chara

Re: Need help running external program

2005-02-27 Thread Pink
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

Need help running external program

2005-02-27 Thread Rigga
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'