-1

i am wondering if it is possible to open an app with python. I did some googling but i did not find anything that works. I tried:

import os
os.system("Settings") 

and

import subprocess
subprocess.Popen("C:\Program Files (x86)\Steam\steam.exe")

but these do not work and i cant find anything else

Thanks in advance!

1 Answers1

1

Your code didn't work because the format of the path is wrong

import subprocess
subprocess.Popen("C:\\Program Files (x86)\\Steam\\steam.exe")

or

import subprocess
subprocess.Popen(r"C:\Program Files (x86)\Steam\steam.exe")
Rohith Nambiar
  • 2,957
  • 4
  • 17
  • 37
  • And this is a good step for OP to add to the process. When that line didn't work, one of the first things you could do is just run `print(os.path.exists("C:\Program Files (x86)\Steam\steam.exe"))`. If you get False, you should suspect there's a problem with the path formatting. – Frank Harris Mar 16 '22 at 16:31
  • Yes, I know right – Rohith Nambiar Mar 17 '22 at 01:50