My question relates to a python program I'm using to run multiple times a program by the command prompt. However, each time the program is called the cmd window shows up and obstructs the screen and more annoying windows focuses on the cmd window (it brings cmd window to the front). I'd like to be able to run the program minimized so that I can continue working without being interrupted.
The code I'm using to call the external program is:
os.system('abaqus cae noGUI=results.py')
If I change py to pyw cmd still pops-up but then hides in about one second and the rest of calculations do not show up. However cmd still show up. Is there a way cmd can start minimized?
I've tried:
def launchWithoutConsole(command, args):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
return subprocess.Popen('abaqus cae noGUI=results.py', startupinfo=startupinfo,
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
But it hangs...