Is there a way to allow only one process to run in the PyCharm IDE at a time?

Answered

When creating and testing code, I often find myself running a script, examining the output briefly, and quickly coming back to it to make changes, and then run it again. However, sometimes these scripts dont finish their execution before I'm done with them (a for loop with exponentially complex iterations that I only see the first few of, and dont care about the rest). I know I can manually stop the process by right-clicking and selecting "Close Tab". However, sometimes I forget and I end up having four processes that are all running essentially infinite loops, and it slows everything down. I only ever need one process running at a time. Is there a way to set an option in PyCharm to limit the number of processes executing concurrently to one? So that when I run the script again, it automatically kills any already running processes (which there should only be one of if this is in effect).

1
1 comment
Avatar
Permanently deleted user

Hello! To allow only one instance to run, go tu "Run" in the top bar, then "Edit Configurations...". Finally, check "Single instance only" at the right side. Hope it helps!

0

Please sign in to leave a comment.