Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open another process in another Window

In my code I would like to launch a function/script in another python window (say, when you run one script, a back window pops up, I want that script to manage other scripts. They don't need to communicate).

Similar to multiprocessing but they have their own pop up windows and outputs. All their information is going to be written to a file there after.

I have searched a fair amount but it seems like no one want a script to run another script in another window, potentially running 4 or 5 python windows consecutively, each using a separate core.

like image 507
Names Are Too Mainstream Avatar asked Feb 18 '26 07:02

Names Are Too Mainstream


1 Answers

You should be able to use os.startfile(filename) Here is an example that runs another python file:

import os

os.startfile("File.py")

print("Started Running!")

This will open and run another python program, allowing this program to continue running.

like image 127
Timmy Diehl Avatar answered Feb 19 '26 21:02

Timmy Diehl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!