I want to make a script that opens a different console with a script attatched to it that runs when the other console opens so you don't have everything happening in the same console window, I've tried doing this but it didn't seem to work
function = """
the script I want to execute in the other window
"""
os.system('start /wait cmd /c python %s' % (function))
python -c "import sys; print(sys.version)"os.systemto start the Windows command processorcmd.exewith option/cto close itself after finishing execution of the command line to use its internal commandstartwith the option/waitto wait for the self-termination of a started second instance ofcmd.exewith option/cto close afterpython.exefinished processing the script file is definitely not a good approach for this task.cmd.exeand all other Windows executables to start another executable without or with STARTUPINFO structure. So the usage ofsubprocess.Popenis highly recommended for this task.python.exeis found bycmd.exeat all and if there is apython.exefound, that the same version ofpython.exeis found bycmd.exe. A user could have multiple versions ofpython.exeinstalled and used a specific version to run the Python script with your code, or the path of the directory withpython.exeis not inPATHat all and the user used therefore the full qualified file name ofpython.exe.