[BangPypers] Reg : Python Scripting

Noufal Ibrahim noufal at gmail.com
Mon Dec 14 06:10:59 CET 2009


On Mon, Dec 14, 2009 at 10:04 AM, murugadoss <murugadoss2884 at gmail.com>wrote:

> Hello,
>   I am new to python scripting. I saw about subprocess module. I need to
> send an input to the running src,like
>
> eg: For adding two numbers
>       1. image running and waiting for input from user
>        2. input 1
>       3. input 2
>
> eg:
> ./add.src
> 2
> 3
> Can u please give me some more input how to pass there inputs



You can write to the stdin of a running process. Did you look at the docs?
Check out the communicate method of the Popen objects. There's also this
that you might find useful
http://blog.doughellmann.com/2007/07/pymotw-subprocess.html

-- 
~noufal
http://nibrahim.net.in


More information about the BangPypers mailing list