with open python

dir = 'C:\\myprogram.exe'

import os
os.startfile(dir)
os.system(dir)

import subprocess
subprocess.Popen([dir])
subprocess.call(dir)

Here is what the above code is Doing:
1. It’s creating a variable called dir that contains the path to the program you want to open.
2. It’s importing the os module.
3. It’s using the os.startfile() function to open the program at the path contained in dir.
4. It’s using the os.system() function to open the program at the path contained in dir.
5. It’s importing the subprocess module.
6. It’s using the subprocess.Popen() function to open the program at the path contained in dir.
7. It’s using the subprocess.call() function to open the program at the path contained in dir.