Answers for "python console run file"

12

run python file using python code

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

python execute file

import fileB #Replace fileB with the apportite file name
fileB.my_func() #Can replace 'my_fun' with a function from the second .py file
execfile('file.py') #Executes the .py file
Posted by: Guest on February-03-2021
2

how to do a console command with python

import subprocess

subprocess.run("Your command here")
Posted by: Guest on August-01-2021
0

python console

print(ord('Z'))
Posted by: Guest on September-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language