My codes never stop running even after getting the output

Each time I run a simple python code, as simple as print(“Hello World!”), although I get the output, it keeps running without doing anything. When I then try to run another code, it runs but shows a “Signal: terminated” in the previous code

Expected vs Current Behavior:

Steps to reproduce:

Bug appears at this link: https://replit.com/@elliotogbechina/day-1-printing-start

Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0

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

Welcome to the forums, @elliotogbechina!
Signal terminated notifies us that the program has stopped. There may be a infinite for loop, or such that is preventing your code from stopping automatically.

There is no infinite loop to the best of my knowledge. It happens to all codes I write. Codes as simple as print (Hello)

Have you tried pressing the “stop” button at the top of the page?

Hi @elliotogbechina , welcome to the forums!
I’ve encountered this before.
Either:

  1. Quickly press the ‘Stop’ button when it is running, force-stopping the repl.
  2. Try entering kill 1 in the Shell.

Hope this helps!

1 Like

Yes I have. It stops and shows “Signal terminated” message against the output. It doesn’t stop me from running other queries though. It’s just something worried about as it shouldn’t be so.

Hello,
this is a “problem” that occurs on older repls like in 100 Days of Code.
It is not that the repl never stops running, it is that the configuration allows you type python code in the console after your repl is done running (so you have to stop it manually).

5 Likes

Great to know. Is there a way to solve the problem or how can I get another version without this problem?

You can edit the configuration of the repl to avoid this “problem” (it is really just an old, intended feature). You will have to do this for every repl of the 100 Days of Code.
(Also, note that using exit() or similar functions in your code can cause problems, you may see this in later days.)

To edit configuration to stop automatically after running, open the Shell and paste in the following command:

sed -Ei 's/^(\s*)"-i"/\1# "-i"/' .replit

(For those who are curious, this comments out the -i option/argument for the prybar interpreter run command, in the .replit file.)

1 Like

Hi,
For some reason, it’s not letting me paste in shell.
Do I past on the first line. I don’t really know how shell works for now.

Try Command (or CTRL) Shift V.

You can paste in shell using Ctrl+Shift+v. Just paste it in and press enter.

Hi,
it worked for the first query I ran. However, when I try to run another query, it just keeps ‘working’ without producing any output

Are you using exit() anywhere in your code? It is known to cause problems where the repl gets stuck in Working.

1 Like

Hi,
No, not at all. I usually try to run it with the simplest of codes.

Try using this shell command, by Firepup650, to update the configuration of the repl.

curl -s https://firepup650.replit.app/raw/minifier|bash -s

Hi, I don’t seem to know how this works

Could you share a link to the repl that is having the problem?
Did the shell command work or was there an error?

The shell command works but it deletes the venv file that comes with the fork

There should be a new .pythonlibs folder that is intended to replace that. Try also typing poetry install in the shell.