Skip to content
How to run files that are not named main.py?
Profile icon
KarthikeyanM2

By default, repl runs files that are main.py but If I want to run someother file. How can I run it?

You are viewing a single comment. View All
Profile icon
Coder100

There are two ways to do this.

1. Creating a .replit file

Creating a .replit file changes what file is being run.

run="python <file>.py"

Change <file> to your other file. Maybe dummy?

2. Importing files

Importing files will allow you to run both files one after the other.

import dummy # ... your main.py code was here ...