How to save and run a python file

i want to run my new python file, but each time i run code, previous python file gets run…

Replit Profile:

1 Like

Hey @mehtansh1st!

Just click the next to “Files” then click Show hidden files. Next click on the .replit file and finally you can change the entrypoint to whatever file you want to run.



Show hidden files


You should also see the docs on how to configure a Repl:

And if you want to run the last edited file, take a look at this post:


When you want to start a new file, you can rename the current one from to something else


Then, create the new file and name it

Now when you click run you’ll see the output of the new code, and you don’t have to mess with the .replit file.

You should be aware though that the history of the file will not be copied over when you rename it, the history remains in and can be recovered when you recreate

Also, you could, when you’re ready to make a new file, duplicate the current file, (saving a copy of it,) and then erase the contents of and write your new code.

Like in the previous version, the history is not copied over when you duplicate the file, and instead remains in

You can also always just delete your current code in and then write your new code. Then, whenever you want to go back to one of the previous versions just use the file history, though you should make note of the significant history points to prevent losing your working code if you’re working through lots of errors and making tweaks.

Write the new code.

Then use history to go back to the previous code.

1 Like