Skip to content

Commit fa8b229

Browse files
committed
update readme
1 parent ae6a36b commit fa8b229

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ It's a fork/optimized version from [elifiner/pydump](https://github.com/elifiner
77
* Optimize code structure && remove redundant code
88
* fix bug in python2.7 && support python3.10+
99
* supported more pdb commnd
10+
* a useful command line tool for debug
1011

1112

1213
Pydumpling writes the `python current traceback` into a file and
@@ -125,5 +126,33 @@ Type "help", "copyright", "credits" or "license" for more information.
125126
10 -> inner()
126127
(Pdb)
127128
```
129+
130+
### Use Command Line
131+
132+
Use command line to print the traceback:
133+
`python -m pydumpling --print test.deump`
134+
135+
It will print:
136+
```python
137+
Traceback (most recent call last):
138+
File "/workspaces/pydumpling/tests/test_dump.py", line 20, in test_dumpling
139+
outer()
140+
File "/workspaces/pydumpling/tests/test_dump.py", line 14, in outer
141+
inner()
142+
File "/workspaces/pydumpling/tests/test_dump.py", line 10, in inner
143+
c = a + b # noqa: F841
144+
TypeError: unsupported operand type(s) for +: 'int' and 'str'
145+
```
146+
147+
148+
Use command line to do pdb debug:
149+
`python -m pydumpling --debug test.deump`
150+
151+
It will open the pdb window:
152+
```python
153+
-> c = a + b
154+
(Pdb)
155+
```
156+
128157
## TODO
129158
- []

README_zh.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* 优化代码结构, 去除冗余代码
66
* 修复其在2.7及3.10版本中的bug
77
* 支持更多的pdb命令
8+
* 提供了一个方便用来调试的命令行工具
89

910
pydumpling可以在代码的任何位置中,将当前Python程序的traceback写到一个文件中,可以稍后在Python调试器中加载它。目前pydump支持很多兼容PDB api的调试器(pdbpp, udb, ipdb)
1011

@@ -122,5 +123,32 @@ Type "help", "copyright", "credits" or "license" for more information.
122123
(Pdb)
123124
```
124125

126+
### 命令行使用
127+
128+
使用命令行来打印traceback:
129+
`python -m pydumpling --print test.deump`
130+
131+
将会输出:
132+
```python
133+
Traceback (most recent call last):
134+
File "/workspaces/pydumpling/tests/test_dump.py", line 20, in test_dumpling
135+
outer()
136+
File "/workspaces/pydumpling/tests/test_dump.py", line 14, in outer
137+
inner()
138+
File "/workspaces/pydumpling/tests/test_dump.py", line 10, in inner
139+
c = a + b # noqa: F841
140+
TypeError: unsupported operand type(s) for +: 'int' and 'str'
141+
```
142+
143+
144+
使用命令行来进行pdb调试:
145+
`python -m pydumpling --debug test.deump`
146+
147+
将会打开pdb调试会话:
148+
```python
149+
-> c = a + b
150+
(Pdb)
151+
```
152+
125153
## TODO
126154
- []

0 commit comments

Comments
 (0)