Ask coding questions

← Back to all posts
Can i run another file without being the Main.py?
MiguelFilippo (0)

Hi guys, Im a beginner in python and in repl IDE, and im having some problems to run my own files .py. It just runs what is in the main.py, even if im reading the file that i created. Can i run my files? if yes, how?
Thx =D
(obs: im brazilian, thats why my code is in portuguese sometimes)

Commentshotnewtop
Highwayman (1367)

https://docs.repl.it/repls/dot-replit
if you don’t know sh or bash, then the command you’d use is python FILE where FILE is the file you want to run.

Shemira (13)

Not sure if this helps, but try taking a look a this: https://docs.repl.it/repls/dot-replit
Also, if you want to use files other than main.py, just import them into main.py. https://docs.python.org/3/reference/import.html