Using another python file

When I open a new python file, write a code and run it. It defaults to the code written on the main.py file. Even if I close the main.py file, it still defaults to code written on that.

code snippet

Hey @KevinWencel welcome to the forums!

To change the python file being ran go to the .replit file. To get to it click the 3 dots next to your files and click Show Hidden Files. In the .replit file change the run = command to have your python file instead of the main.py file. Hope this helps!

2 Likes

Welcome to Ask! This is intended and the solution proposed by SalladShooter will allow you to change which file you run manually. If you would like to automatically run the last edited file, follow the steps below:

4 Likes

Thanks a lot that seems to work

kev

2 Likes

Hey @KevinWencel!

Please mark a post as the solution if it solved your problem so people with the same issue can easily find the solution.

2 Likes