“arquivo de execução python” Respostas de código

Execute o arquivo py em outro arquivo py

os.system('python my_file.py')
Tremendous Enceladus

arquivo de execução python

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
Muddy Mamba

Execute o arquivo python usando o código Python

exec(open('file.py').read())
Blue Butterfly

Como executar um arquivo python de outro arquivo python

import  myfile

myfile.myfunction


#calls a specific function from within the file


Muddy Monkey

Respostas semelhantes a “arquivo de execução python”

Perguntas semelhantes a “arquivo de execução python”

Mais respostas relacionadas para “arquivo de execução python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código