469,293 Members | 1,319 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,293 developers. It's quick & easy.

Calling Exe from Python

Hello Folks,

This is what i am required to do.
Call an executable from my python script, and when the executable is
fininshed running, i should continue with my python script.

I have tried "os.exec()" but it calls the executable and never returns
to the calling python script.
I tried "os.fork" it will start an independent process,
since logic of my program depends on the results of executable.

I am unable to figure, how to do it.
Hope you folks would help me.

~JinBaba

May 2 '07 #1
2 7115
In <11**********************@n76g2000hsh.googlegroups .com>, M Abbas wrote:
This is what i am required to do.
Call an executable from my python script, and when the executable is
fininshed running, i should continue with my python script.

I have tried "os.exec()" but it calls the executable and never returns
to the calling python script.
I tried "os.fork" it will start an independent process,
since logic of my program depends on the results of executable.
Take a look at `os.system()` or the `subprocess` module.

Ciao,
Marc 'BlackJack' Rintsch
May 2 '07 #2
I've been using subprocess.call(['name','arg1','arg2']) Works fine.

On 2 May 2007 03:48:19 -0700, M Abbas <ab*****@gmail.comwrote:
Hello Folks,

This is what i am required to do.
Call an executable from my python script, and when the executable is
fininshed running, i should continue with my python script.

I have tried "os.exec()" but it calls the executable and never returns
to the calling python script.
I tried "os.fork" it will start an independent process,
since logic of my program depends on the results of executable.

I am unable to figure, how to do it.
Hope you folks would help me.

~JinBaba

--
http://mail.python.org/mailman/listinfo/python-list
May 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bill Orcutt | last post: by
reply views Thread by Natsu Mizutani | last post: by
2 posts views Thread by Satish Chimakurthi | last post: by
9 posts views Thread by F. GEIGER | last post: by
11 posts views Thread by Kamilche | last post: by
1 post views Thread by Stephen Kellett | last post: by
1 post views Thread by Gerald Klix | last post: by
10 posts views Thread by Finger.Octopus | last post: by
47 posts views Thread by teju | last post: by
16 posts views Thread by Jaco Naude | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.