How do I call the Python's list while debugging?

后端 未结 3 1878
旧时难觅i
旧时难觅i 2020-12-24 04:24

I have the following python code:

values = set([1, 2, 3, 4, 5])
import pdb
pdb.set_trace()

I run the script and I am in the debugging shell

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 05:01

    Just print it:

    (Pdb) print list(values)
    

    don't foget to add brackets for python3 version

    (Pdb) print(list(values))
    

提交回复
热议问题