I have two python scripts, test_breakpoints.py and test_breakpoints_import.py (see below), with breakpoints set in PyCharm. The former script imports a function from the latter.
When using the interactive console (IPython), connecting the debugger, and running code (via Alt+Shift+e), PyCharm ignores the breakpoints in test_breakpoints.py and only triggers upon the breakpoint in the imported function from test_breakpoints_import.py. This is different from Debug Script (via Shift+F9), whicht triggers on the first breakpoint.
Why are breakpoints for non-imported code ignored when using the debugger inside the interactive console? Is there a way that PyCharm triggers these breakpoints (without putting the code into a different script and importing it from there, or debugging the entire script)?
I am often using the console for interactive coding and would like to avoid running entire scripts just to debug small code parts.
test_breakpoints.py
from test_breakpoints_import import myfunc_import
def myfunc_local():
print('Bye')
print('Hello')
myfunc_local()
myfunc_import()
test_breakpoints_import.py:
def myfunc_import():
print('Hi')
Running code in IPython interactive console (Alt+Shift+e):
Debug script (Shift+F9):