Code does not work with new file

Question: console does not showing the output of my new file. it always show the 1st main.py output

Replit Profile: https://replit.com/@SwarupKumar2

Hey @SwarupKumar2!

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.

Images

Dots

Show hidden files

edited

You should also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl

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

2 Likes

Welcome to the community, @SwarupKumar2!

I don’t want to confuse you too much, so I’ll keep it simple. If you’d like to change what file you run, click the next to the “Create New Folder” button in your file manager and press “view hidden files”. After this, change the entrypoint in your .replit file to be whatever file you’d like to run.

If it works better for you, feel free to invite me to your Repl so I can do it for you.

2 Likes


changing the entrypoint it shows like this. please help me out of this problem.

@SwarupKumar2 newpgrm.py is in a folder. Change the entrypoint to Week1/newprgm.py.

2 Likes

every time if i want to make new file/ folder i need to change this entrypoint???/ Please give me a permanent solution where there is no need to change it again and again when i want to make new file/ folder, and I can get the output of running any file whenever I want.

onBoot = '''/nix/store/fbi9r30p3lqk96lmw5b1v1bpbj62cr2l-inotify-tools-3.20.11.0/bin/inotifywait -rqme create --format=%f%w --include='\..+\.py.[0-9]+~' .|while
read f
do
f=${f#.}
o=
r=
while
read -r l||[ "$l" ]
do
case $r
in
"")case $l
in entrypoint*)m="${l%\"*\"}\"${f#*~./}${f%.*~*}\""
case $m
in
"$l")break
esac
l=$m
r=1
esac
esac
o="$o$l
"
false
done<.replit||echo -n "$o">.replit
done'''

And run kill 1 in Shell.
This will map the entrypoint to the last file you edited through the IDE.
Replace .+\.py on line 1 with the ERE of the files you want to be auto-set as entrypoint.
(I tried an option which checks for you just visiting the file in the editor but I found that that’s impossible. Maybe you can do this with an extension)

1 Like

@SwarupKumar2 As @KAlexK said, the best way to do so is the following:
You can also invite me to your repl and I can do it for you.

how to invite you to change this?

@SwarupKumar2 Just press the “invite” button next to the “deploy” button and type “RedCoder”. Then just press the plus button to invite me.

2 Likes

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