hey guys,
Got another question:
in C programming etc we can stop an execution of say an infinite look by pressing Ctrl+C.
What's the equivalent in python? i'm using the IDLE GUI. I've found myself in situations where its running a never ending long task which i want to stall, but i just dont know how, and it ends up with my python crashing or having to restart it...

Recommended Answers

All 3 Replies

In idle you can restart the shell in the shell menu. Normally, this kills your execution because idle starts a new process.

In idle you can restart the shell in the shell menu. Normally, this kills your execution because idle starts a new process.

Yeah I tried that a couple of times, but there were some instances where even the *.py file too had to be close (in the task manager) and IDLE has to be restarted completely, so was wondering if there was any other way that i didnt know of.
But yeah, closing the shell does help most of the time.

You can stop using IDLE and just run your code in the console, which retains the usage of Ctrl+C (I believe that IDLE tries to catch Ctrl+C)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.