ipython / ipython/ipykernel

How can i show an input box when debugging using pdb?

Đang mở
#586 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
734
Fork
412
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Mô tả

When i try to debug with `from IPython.core.debugger import Pdb; Pdb().set_trace()` or `import ipdb; ipdb.set_trace()`, jupyter doesn't show an input box for debugging. Even if I restart kernel and run the code again, it doesn't show the input box. Here is the cell output.
![Screenshot from 2021-01-28 23-47-08](https://user-images.githubusercontent.com/76247476/106155562-29573f00-61c4-11eb-9ce9-09187dec313b.png)

I was expecting like this.
![https___qiita-image-store s3 amazonaws com_0_10290_3c195522-a68b-5610-c070-ca60b63afcc3](https://user-images.githubusercontent.com/76247476/106156312-b601fd00-61c4-11eb-809d-b99c5234b4c8.png)

> For those reproducing this:
>
> ```python
> def my_sum(initnum, step, n):
> x = initnum
> from IPython.core.debugger import Pdb; Pdb().set_trace()
> for i in range(n):
> x = x + step
> return x
> my_sum(10, 2, 3)
> ```

When i try this on jupyter lab, it worked! but when i store the code in a file and ran `!python pdb_test.py` , it didn't show an input box.
![Screenshot from 2021-01-29 15-22-26](https://user-images.githubusercontent.com/76247476/106239457-fce40700-6245-11eb-9213-e30a135e9872.png)

but running py file with the code :/
![Screenshot from 2021-01-29 15-25-25](https://user-images.githubusercontent.com/76247476/106239658-52b8af00-6246-11eb-9dfa-e13092004f51.png)

pdb_test.py
![Screenshot from 2021-01-29 15-27-25](https://user-images.githubusercontent.com/76247476/106239832-99a6a480-6246-11eb-91f9-5db8307b2c19.png)

Here is my environment
```

conda list ipython
# packages in environment at /home/zzz/anaconda3:
#
# Name Version Build Channel
ipython 6.1.0 py36hc72a948_1
ipython_genutils 0.2.0 py36hb52b0d5_0

```

```
jupyter-lab --version
3.0.5
```
ubuntu 18.04

Google Chrome
Version 88.0.4324.96 (Official Build) (64-bit)

I posted this issue first here **https://github.com/jupyterlab/jupyterlab/issues/9691**

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.