'Is it possible to use python code to open another application? [duplicate]

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!



Solution 1:[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")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rohith Nambiar