954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

running a process from a python program

Hello beautiful people..!

i need a way to run a python program from another one...

does anyone know what is the best way to call a process which runs another program in python, and when running that child process, causing the parent process to continue without waiting for the child process to return?

Avner .H.
Newbie Poster
18 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

To get two Python functions running concurrently, you're going to need to look at Python's threading modules.

There is a good site with example code here .

As for the main question, well, you could always exec() the second Python program from the first. But please don't do this unless you absolutely have to. A much neater solution is to import the second Python program as a module, then call its functions in a separate thread.

G-Do
Junior Poster
147 posts since Jun 2005
Reputation Points: 41
Solved Threads: 31
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You