Reputation: 4098
I have a module bar
that defines a function foo
. I can use PyCharm console to call this function:
import bar
bar.foo()
Is it possible to make PyCharm debug the code during such code, i.e. stop at breakpoints?
If it matters, I am using PyCharm on Windows.
Upvotes: 3
Views: 2340
Reputation: 4926
In that case, you just need to define main function to call bar.foo()
:
import bar
if __name__ == '__main__':
bar.foo()
Upvotes: 1