Step into my code does not steps into my python code.

已回答

Using Step over and Step into with F7 and F8 is interesting but I don't want to enter external libraries like random. I tried to use “Step into my code” but nothing seems to work. I activated and deactivated “Always do smart step into” or “Do not step into library scripts” but pushing the button “Step into my code” always ends the debug process immediately. How is that possible? 

import random
letters = "abcd"
c = 8
def f ():
    return 8888
a = f()
x = 8
c = 10
print (a) 

I put the red dot on the left of the line “a = f()” and I expect it to enter inside the body of f, but it just ends everything. Also, I see that if I create more than one breaking point, all that “Step into my code” does is jumping from one bullet point to the next one, after the last one it exits the code.

I noticed that even if I disable the smart step into, it is always active when I restart Pycharm. How is that possible?

 Any ideas? 

 

0

Please update to the latest 2024.2.4 and check the behavior. With the default settings at Settings | Build, Execution, Deployment | Debugger | Stepping (only smart step into enabled)  of having a breakpoint on “ a = f()” the step into should behave like the following:

1

Thanks for your answer. I see that you are clicking on “Step into”, right? 

Let me propose a more complete code to actually see what I am looking for. I put the breakpoint on the very first line, what I want is simply execute line by line without exiting to external libraries. I could use Step into with F7, but it opens the random function. Can you do it without opening the random function AND not switching between Step functions? 

 

import random
c = 88
letras = "abcdefghi"
intento = random.choice(letras)+ random.choice(letras)
def f ():
    x = 99
    d = x +1
    return x
q = 11
z = f()

0

请先登录再写评论。