First of all, you need to understand how do replit’s run button do
it first read through the .replit file which is hidden, find the run variable or entrypoint if included, and run that file
In replit’s python template it is set to run main.py every time you click the run button, so for this error, there is no file named ‘main.py’ and therefore it cannot run a python file called main.py
To fix, you need to
move your python code to a file named main.py
OR
change the entrypoint variable in .replit to the file you want to run (NOT RECOMMENDED)
In the left hand side of your picture I can see your python code is in a file named ‘hello.there’, which obviously, is not a python file(.py) and not ‘main.py’
You can rename your file from ‘hello.there’ to ‘main.py’ aswell
Python actually doesn’t care, as long as the file contains python code. You could use .notpy
if you wanted to, and python would accept it as being fine.
Why wouldn’t you recommend this? It’s perfectly fine to do.
Well yes you’re right, I just want to point it out for them.
Because new users usually mess up the .replit file when they try to edit it (especially editing entrypoint but not run) and don’t know how to fix it, which ruins the entire repl. It is also more annoying to do compared to changing filename