3

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.

4
  • Try Shift+f9 to start debugging. f9 to jump to the next break-point. More info on the web... Commented Jun 26, 2016 at 11:53
  • 1
    AFAIK, Shift+F9 simply starts debugging, contrary to Shift+F10, which runs it with debugging disabled. I am looking for a way to call one specific function from the module with debugging enabled. Commented Jun 26, 2016 at 13:20
  • 1
    I would appreciate a comment related to down-voting, to help me learn. Commented Jun 26, 2016 at 13:21
  • @texnic, I am not someone who down-voted this, but I can guess why. Your question is not programming related; it is a question about how to use a particular program's user interface. So it doesn't fit this site's purpose. Commented Jun 28, 2016 at 6:38

1 Answer 1

1

In that case, you just need to define main function to call bar.foo():

import bar

if __name__ == '__main__':
    bar.foo()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.