Ask coding questions

← Back to all posts
How do I run a file other than main.py?
az148 (0)

Hello folks, im a complete noob to python and replit, was wondering if someone can answer if we are able to run other files than main.py? because there is obviously the option to create additional files but when i click Run - the IDE only runs the main.py

Answered by Dart (1199) [earned 5 cycles]
View Answer
Voters
az148 (0)
Comments
hotnewtop
Dart (1199)

make a file called .replit and inside put run="python filename.py"

az148 (0)

thank you! working!

Dart (1199)

or you can run another file by importing it like import filename and if its in a folder do import foldername.filename