How do I execute code before the debugger starts?

Answered

This question should be easy to answer.

When debugging, I want to execute the code when the interpreter is started, before anything else runs, so that, when debugging, the variables and modules are in the debugger scope. (Note that I do not want to run an external tool that opens in a separate environment.)

This must be possible in PyCharm, but thus far I have not been able to find out how.

Specifically, I want to run this code:

import sip

sip.setapi('QString', 2)

sip.setapi('QDate', 2)

sip.setapi('QDateTime', 2)

sip.setapi('QTextStream', 2)

sip.setapi('QTime', 2)

sip.setapi('QUrl', 2)

sip.setapi('QVariant',2)

 

before anything else runs.

0
1 comment

Hi! Unfortunately, it isn't possible at the moment, please. follow this feature request in our issue tracker:  https://youtrack.jetbrains.com/issue/PY-25854

0

Please sign in to leave a comment.