Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit81b4936

Browse files
authored
added an explanatory code snippet
1 parent5736e53 commit81b4936

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

‎docs/builtin/breakpoint.md‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,26 @@ description: This function drops you into the debugger at the call site. Specifi
1515
</base-disclaimer-title>
1616
<base-disclaimer-content>
1717
This function drops you into the debugger at the call site [...].
18+
<br/>
19+
Python breakpoint() calls Python debugger at a given line
1820
</base-disclaimer-content>
21+
1922
</base-disclaimer>
2023

21-
<!-- remove this tag to start editing this page-->
22-
<empty-section />
23-
<!-- remove this tag to start editing this page-->
24+
```
25+
# Create a loop over 5 integers
26+
for i in range(5):
27+
# Stream i to stdout
28+
print(i)
29+
# Create breakpoint at # 3
30+
if i == 3:
31+
breakpoint()
32+
#Output
33+
0
34+
1
35+
2
36+
3
37+
> c:\users\user\path\to\your\project\example.py(24)<module>()
38+
-> for i in range(5):
39+
(Pdb)
40+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp