Code Not running after Renaming

I changed my python file from to something else. But, it seems the console is still looking for file which doesn’t exist anymore but I don’t want to rename that back to again.
Is there any way to fix it?


Inside your file, you can import your other Python file containing your code, e.g.

import codeFileName # don't need to add the .py extension

Your other code file can be called whatever; importing the name of it in your file will ensure it runs as expected.

There is also a way to configure your Repl to run using a different file entirely, I’m currently in class though will get back to you with this shortly.


In your sidebar there is an option to “Show Hidden Files” (three dots submenu on top right).
Once you show hidden files you will see a file named .replit.

Inside you will see the run button configured:

  • look for there and replace it with your file (eg

Afterwards the run button will execute this one.

Configurations like that are described inside

Hope this helps :slight_smile:


It worked bro Thanks.
Also, you remembered me that other files can be also imported in a Python File.
For your Solution
For your Time
For your Help

Have A Blessed Life

It helped man thanks. Also, learned about accessing hidden files.

Thanks for your kindness and great help.
I really like the way you explained it.
Thanks & Best Of Luck

Have a blessed Life

You can do what @marinesetwas mentioned, but you can also go to shell and type:

python3 [file name].py
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.