Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #42486
| X-Received | by 10.224.18.132 with SMTP id w4mr9006820qaa.1.1364844128578; Mon, 01 Apr 2013 12:22:08 -0700 (PDT) |
|---|---|
| X-Received | by 10.182.54.14 with SMTP id f14mr51690obp.27.1364844128420; Mon, 01 Apr 2013 12:22:08 -0700 (PDT) |
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!ca1no19973051qab.0!news-out.google.com!v17ni6816qad.0!nntp.google.com!ca1no19973047qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Mon, 1 Apr 2013 12:22:08 -0700 (PDT) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=66.109.243.154; posting-account=L6YDbAoAAACbrZmDSstF-pnV-_WrCmeJ |
| NNTP-Posting-Host | 66.109.243.154 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <0c9717ca-52dd-49ce-8102-e1432883858a@googlegroups.com> (permalink) |
| Subject | os.system() with imbeded quotes on centos |
| From | cevyne@gmail.com |
| Injection-Date | Mon, 01 Apr 2013 19:22:08 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Received-Bytes | 1899 |
| Xref | csiph.com comp.lang.python:42486 |
Show key headers only | View raw
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