Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   call shell from python (http://www.velocityreviews.com/forums/t957536-call-shell-from-python.html)

contro opinion 02-12-2013 05:13 AM

call shell from python
 
>>> import os
>>> os.system("i=3")

0
>>> os.system("echo $i")


0
how can i get the value of i?


spilcm@hotmail.com 02-12-2013 10:30 AM

Re: call shell from python
 
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

spilcm@hotmail.com 02-12-2013 10:30 AM

Re: call shell from python
 
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


All times are GMT. The time now is 05:24 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.