Open any program from cmd in python

Question:

I want to open a program in Python in a path
Error

error in cmd: The system cannot find the file steam.exe.

import os
os.system('start steam.exe "D:Program Files (x86)Steam"')```
Asked By: Mohammad Garousi

||

Answers:

use subprocess:

import subprocess

subprocess.call(['D:Program Files (x86)Steam\steam.exe'])
Answered By: Zack Walton
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.