Skip to content
← Back to Community
How to run different files
Profile icon
TobyIbe

I need to make a few different files in python, it only ever can run the main.py file, i know i can import other files but what if i justed wanted to run ONLY that other file

Voters
Profile icon
PavelGoronkov
Profile icon
TobyIbe
Comments
hotnewtop
Profile icon
HackermonDev

You could go to the terminal of repl.it and then type: python3 [file-name] You can go to the terminal by doing: CTRL + Shift + P and then search for shell and click on it.

Profile icon
PersonaOS

just transfer the code in your main file to another file
then you put the following code in your main file

import os def runpy(filename): string = "python3 " + filename os.system(string)

then just type in your main file in a new line

runpy([your file's name with .py])