My app doesn't respond when I use subprocess.call(['notepad.exe', path]) Does anyone know the reason for this?
(notepad opens the file in path correctly)
My app doesn't respond when I use subprocess.call(['notepad.exe', path]) Does anyone know the reason for this?
(notepad opens the file in path correctly)
You're running this on the thread that's responsible for GUI. The call to subprocess.call
returns only when the called program terminates. While it's still running, the function just sits there and waits, so your GUI is forced to wait as well.
To avoid this, run this function in another thread or use a non-blocking cousin of subprocess.call
.