How do I execute code before the debugger starts?

已回答

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

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

请先登录再写评论。