Python Forum

Full Version: How do I run a program without any relationship to it?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I see that there are many ways to launch a program from Python, but I cannot find specifically what I am looking for.

I need to be able to run a program and not have any ties to it. I don't care what happens after it launches. I don't need a return code, or to monitor it, or have any knowledge of it whatsoever.

On Windows and the solution doesn't need to be cross platform. And using a library is fine.

What are my options?

Thank you.
Do you want to run a python script without a console or any kind of window, or do you want a Python program to run another program?
So, I think you are asking how to launch a program from within python? If correct, would look at the sub process module
I currently have a Python console running in an infinite loop with a 1 second sleep.
I may, at some point, make it windowless, but for now I am monitoring it via the console.

So, at certain times, I wish the console to run things. Those things could be another python script, an executable, a PowerShell script or whatever one could imagine. But the main thing being that it have no relation to the Python application that launched it. And this is only for the fact that I am concerned about memory issues if things don't get cleaned up.

Thank you, Jef. I will look into the sub process module.