Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38727 > unrolled thread

call shell from python

Started bycontro opinion <contropinion@gmail.com>
First post2013-02-12 13:13 +0800
Last post2013-02-12 02:30 -0800
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  call shell from python contro opinion <contropinion@gmail.com> - 2013-02-12 13:13 +0800
    Re: call shell from python spilcm@hotmail.com - 2013-02-12 02:30 -0800
    Re: call shell from python spilcm@hotmail.com - 2013-02-12 02:30 -0800

#38727 — call shell from python

Fromcontro opinion <contropinion@gmail.com>
Date2013-02-12 13:13 +0800
Subjectcall shell from python
Message-ID<mailman.1684.1360646021.2939.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

>>> import os
>>> os.system("i=3")
0
>>> os.system("echo $i")

0
how can i get the value of  i?

[toc] | [next] | [standalone]


#38738

Fromspilcm@hotmail.com
Date2013-02-12 02:30 -0800
Message-ID<5e53dd40-80f9-4632-b150-2b302a97201b@googlegroups.com>
In reply to#38727
On Tuesday, February 12, 2013 6:13:38 AM UTC+1, contro opinion wrote:
> >>> import os
> >>> os.system("i=3")
> 0
> >>> os.system("echo $i")
> 
> 
> 0
> how can i get the value of  i?

You may want to take a look at the pexcpect module : http://www.noah.org/wiki/pexpect

[toc] | [prev] | [next] | [standalone]


#38739

Fromspilcm@hotmail.com
Date2013-02-12 02:30 -0800
Message-ID<mailman.1695.1360665008.2939.python-list@python.org>
In reply to#38727
On Tuesday, February 12, 2013 6:13:38 AM UTC+1, contro opinion wrote:
> >>> import os
> >>> os.system("i=3")
> 0
> >>> os.system("echo $i")
> 
> 
> 0
> how can i get the value of  i?

You may want to take a look at the pexcpect module : http://www.noah.org/wiki/pexpect

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web