Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #42486
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-04-01 12:22 -0700 |
| Message-ID | <0c9717ca-52dd-49ce-8102-e1432883858a@googlegroups.com> (permalink) |
| Subject | os.system() with imbeded quotes on centos |
| From | cevyne@gmail.com |
I get the example os.system('ls -al') no problem.
i'm trying to create a variable with my command built in it but needs to include quotes.
Portion of code is as follows:
someip = '192.168.01.01'
var1 = 'lynx -dump http://' + someip + '/cgi-bin/xxxx.log&.submit=+++Go%21+++ > junk'
print var1
os.system(var1)
If I print var1 it looks right . If I use the os.system(var1) as above it seems to have a problem near the end of the string with msg
sh: .submit=+++Go%21+++: command not found
clearly there is some escape sequence that I don't understand .
I tried combinations of single and double quotes and mixed around var1 in os.system(), but that generates command not found.
I need it to look like how I enter it manually and works
lynx -dump 'http://192.168.01.01/cgi-bin/xxxx.log&.submit=+++Go%21+++ > junk'
Probably obvious to many but i'm spinning my wheels. many thanks for help .
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
os.system() with imbeded quotes on centos cevyne@gmail.com - 2013-04-01 12:22 -0700
Re: os.system() with imbeded quotes on centos Chris Angelico <rosuav@gmail.com> - 2013-04-02 06:33 +1100
Re: os.system() with imbeded quotes on centos John Gordon <gordon@panix.com> - 2013-04-01 20:26 +0000
Re: os.system() with imbeded quotes on centos Cameron Simpson <cs@zip.com.au> - 2013-04-06 09:00 +1100
Re: os.system() with imbeded quotes on centos Chris Rebert <clp2@rebertia.com> - 2013-04-05 16:36 -0700
csiph-web