Answers for "run python script linux"

6

run linux command using python

import subprocess
subprocess.call("command1")
subprocess.call(["command1", "arg1", "arg2"])
Posted by: Guest on July-31-2020
23

execute command in python script

import os

os.system("ma Commande")

#Exemple:

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

run python file using python code

exec(open('file.py').read())
Posted by: Guest on May-24-2020
0

Windows 10 running python scripts from cmd

# move to the directory where the script is located and run it like so
cd (path to directory)
python name.py
Posted by: Guest on November-13-2020

Code answers related to "run python script linux"

Python Answers by Framework

Browse Popular Code Answers by Language