Skip to content
← Back to Community
How to save python codes and call from main.py
Profile icon
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
Profile icon
Manasvi2007
Profile icon
MuhammadZahidZa
Profile icon
mmirza2
Profile icon
harikesh1
Profile icon
ChineduAsuzu
Profile icon
sunamrabose
Comments
hotnewtop
Profile icon
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

Profile icon
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.