Files
openide/python/testData/debug/test_add_breakpoint_after_run.py
Egor Eliseev 52eaf0d631 PY-78884 Linux in Docker for PyCharm config PyEnvTestsDebugger
First iteration. Minor errors fixed.


Merge-request: IJ-MR-154104
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: c4410fdf09edef7c0974ecb6bb15dbd465defbca
2025-01-31 17:44:33 +00:00

27 lines
833 B
Python

import time
def calculate_sum(a, b):
# Use a breakpoint here to inspect the program flow
result = a + b
return result
def greet(name):
# Use a breakpoint here to debug the call
print("Hello, {name}!".format(name=name))
if __name__ == "__main__":
counter = 0
while True:
print("\nIteration:", counter) # You can set a breakpoint here while the loop runs
num1 = counter
num2 = counter + 1
sum_result = calculate_sum(num1, num2) # Step into this function during debugging
print("The sum of {num1} and {num2} is: {sum_result}".format(num1=num1, num2=num2, sum_result=sum_result))
greet("Debugger") # Also step into this function if needed
counter += 1
# Add a sleep to slow down the loop and make debugging easier
time.sleep(2)