Answers for "how to run file using command in python"

28

execute command in python script

import os

os.system("ma Commande")

#Exemple:

os.system("cd Documents")
Posted by: Guest on June-10-2020
0

How to run a File using python

import subprocess  #imports the module thats needed
subprocess.call([r'C:UsersRonDesktopTestcurrent_date.bat'])  #runs the file in the given directory
Posted by: Guest on November-05-2021

Code answers related to "how to run file using command in python"

Python Answers by Framework

Browse Popular Code Answers by Language