My code is not working on any filename other than the file

Problem description

here when i try to run the code from any other file , for ex: other than the code is showing some error .
if multiple files present in replit with even when you run other code the code in will execute

Expected behavior

here the code should print hello

Actual behavior

instead it is showing No such file or directory

Steps to reproduce

so please check what is the case of problem



windows 10

Device if mobile



free tier

Please upload screenshots

:wave: Welcome to the forums, @natamsravankuma!
You named your Python file, when it should be named, as this is the default file to be run on Replit,

For your information, if you intend to run instead of, 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


1 Like

thanks for replying
after changing entry point the code in the given file is only executing instead
cant we run the code in different files listed in file explorer

Hey, @natamsravankuma!
This is not currently a built-in feature in Replit, but you can follow these instructions to use a somewhat-accurate script to switch the current running file by figuring out which file was last edited:

(Do keep in mind this is not 100% accurate)


thanks a small doubt where should i run this code

No problem! You can put this code at the very beginning of your .replit file. You can refer to my original instructions on accessing this .replit files if you need assistance.