I want to be able to start an application for example Notepad or Chrome using a python script. I have tried to use the os.startfile() function :
import os
os.startfile('Notepad')
It works but when I run a cmd command through it for example whoami :
import os
os.startfile('whoami')
This opens a window that automatically closes. Another thing is when using the subprocess module and opening the application from there, the program hangs. It waits for me to close the program I opened before continuing execution. I want to be able to run applications while being able to run cmd commands and storing the output in a variable without the program waiting for me to exit the application it opened, all in a single function. How can I achieve this with the criteria I have set in mind