Debugging multithreading

24 views
Skip to first unread message

frgoo

unread,
Aug 11, 2025, 5:48:57 AMAug 11
to PyScripter
Hello.

I have problems debugging multithreaded applications in PyScripter. Maybe anyone has a suggestion how to overcoms this.

When doing something like the following:

th = threading.Thread(target = worker)
th.start()
input('Press key to shutdown application')

I'm not able to debug the created thread cause the 'input' function creates a modal input window which is blocking the GUI of PyScripter and so also the debugger.

As a workaround I tried to replace 'input' by 'msvcrt.getch()' which does not create a input window however there seemsto be no way that any keypress reaches the application beeing debugged.

Then I tried to replace the 'input()' call by using a threading.Event :

ex = threading.Event()
ex.wait()

and setting the event 'ex' in a SIGTERM handler, however I found now way to send CTRL+C to the main thread when run from PyScripter.

All the above works when running outside of PyScripter.

Any suggestions for a workaround to make it possible to debug such application design with PyScripter?

Thanks a lot for additional ideas.

frgoo

unread,
Aug 12, 2025, 4:03:21 AMAug 12
to PyScripter
@PyScripter:

Thanks a lot for your email. The workaround you showed can indeed be used to circumvent the problem.

Kind Regards

frgoo
Reply all
Reply to author
Forward
0 new messages