Ask coding questions

← Back to all posts
How to save python codes and call from main.py
sunamrabose

I'm new here. Could anyone help me saying, where can I save my python code in "repl.it" editor and run them from "main.py"?

Voters
MuhammadZahidZa
mmirza2
harikesh1
ChineduAsuzu
sunamrabose
Comments
hotnewtop
Chrisgopher

You can add a file in your repl, and to run it you either need to copy your code in main.py , or type just import <file_name>
If you've saved your file in a folder in your repl, then the command is import <foldername.file_name>
Note: Folder and File names cannot have special characters or spaces in their name, or a syntax error might occur, valid_file_name.py and not so valid file name.py

ash15khng

You can create a repl, type in your code in the file called main.py and click run at the top of the screen.