转载:http://askandstudy.blog.163.com/blog/static/19975205820122794551164/
environment:
这个链接里有篇文章可以看看需要怎么做。Winpdb 1.4.8 was released. This is a maintenance release that fixes compatibility issues with Python 2.7 and 3.x. You can download it from winpdb.org/download.
Wednesday, May 14, 2008
Debug Python 3 with Winpdb 1.3.8 Tychod
Thanks to Nir Aides , the developer of Winpdb I have learned how to debug source code of Python 3 in winpdb . There is some trade - off , though :In Windows XP, the last step is done like this:
- You must have both Python 2.5 and Python 3 installed.
- When installing, wxPython for Python 2.5 (unicode), make sure you have Python 2.5 in the PATH instead of Python 3.
- When installing winpdb, make sure to have PATH set back to Python 3. Install winpdb into the directory of Python 3 (otherwise it won't work). (There may be an error message at the end of installation, just ignore it.)
- You must run winpdb with Python 2.5 but rpdb with Python 3
- Change PATH from C:\Python30 to C:\Python25
- Start new cmd window (otherwise it won't notice the changed PATH)
- Run (c:\Python30\Lib\site-packages>)python winpdb.py
- Change PATH back to C:\Python30
- Start another cmd window (to make it notice the new PATH)
- From the winpdb directory run python rpdb2.py -pwd=<somePassword> -d <filename> <command line arguments for your python script>
- in the GUI window of winpdb do File/Attach and write the password you selected for rpdb2.py in the command line
D:\devsoftware\python\winpdb-1.4.8>dir /w 驱动器 D 中的卷是 others 卷的序列号是 A48D-EC9C D:\devsoftware\python\winpdb-1.4.8 的目录 [.] [..] .hgtags .hg_archival.txt [artwork] [build] MANIFEST README.txt rpdb2 rpdb2.bat rpdb2.py rpdb2.pyc setup.py winpdb winpdb.bat winpdb.py winpdb.pyc winpdb_.pyw winpdb_inst.py [__pycache__] 15 个文件 1,118,979 字节 5 个目录 36,444,315,648 可用字节 D:\devsoftware\python\winpdb-1.4.8>c:\python32\python.exe setup.py install -f running install running build running build_py running build_scripts creating build\scripts-3.2 copying winpdb_inst.py -> build\scripts-3.2 copying and adjusting winpdb_.pyw -> build\scripts-3.2 copying winpdb.bat -> build\scripts-3.2 copying rpdb2.bat -> build\scripts-3.2 running install_lib copying build\lib\rpdb2.py -> c:\python32\Lib\site-packages copying build\lib\winpdb.py -> c:\python32\Lib\site-packages byte-compiling c:\python32\Lib\site-packages\rpdb2.py to rpdb2.pyc byte-compiling c:\python32\Lib\site-packages\winpdb.py to winpdb.pyc running install_scripts copying build\scripts-3.2\rpdb2.bat -> c:\python32\Scripts copying build\scripts-3.2\winpdb.bat -> c:\python32\Scripts copying build\scripts-3.2\winpdb_.pyw -> c:\python32\Scripts copying build\scripts-3.2\winpdb_inst.py -> c:\python32\Scripts running install_egg_info Writing c:\python32\Lib\site-packages\winpdb-1.4.8-py3.2.egg-info D:\devsoftware\python\winpdb-1.4.8>
![winpdb调试python3 - askandstudy - 第二实验室](http://img9.ph.126.net/SXtmF54DhgzCrRf3E--mQg==/2726366624436713229.jpg)
![winpdb调试python3 - askandstudy - 第二实验室](http://img2.ph.126.net/tSVT_h1PNLEqHQE5D6yhHg==/2716233525275125312.jpg)
![winpdb调试python3 - askandstudy - 第二实验室](http://img6.ph.126.net/wr3lb7Vgnv2M4nz0yVulFw==/2688086027604062726.jpg)
![winpdb调试python3 - askandstudy - 第二实验室](http://img1.ph.126.net/yq7AqPTwADc5khuoqcg6YA==/104145741400248361.jpg)
![winpdb调试python3 - askandstudy - 第二实验室](http://img6.ph.126.net/xNDT-5M_jkwDSym9OU1kmQ==/2889059160975475186.jpg)
![winpdb调试python3 - askandstudy - 第二实验室](http://img3.ph.126.net/STX-4Vvdt2a5HwS1AZ_C7A==/580401401994675203.jpg)
![winpdb调试python3 - askandstudy - 第二实验室](http://img9.ph.126.net/MtL2JdmwkQmWujKxZpTXeg==/2892718335672705729.jpg)
![winpdb调试python3 - askandstudy - 第二实验室](http://img5.ph.126.net/Ho6rxw2U-Kgd0mfLvuJywg==/595038100783622235.jpg)