Answers for "command to execute a python file"

30

execute command in python script

import os

os.system("ma Commande")

#Exemple:

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

How to run a File using python

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

Code answers related to "command to execute a python file"

Python Answers by Framework

Browse Popular Code Answers by Language