Moin Debug with Winpdb
In case of difficult errors (traceback) you need a powerful tool to debug - Winpdb
Install WxPython for Mac
Get the WxPython binary for Mac OS X from wxPython2.9-osx-22.214.171.124-cocoa-py2.7.dmg
Because of a problem with Mountain Lion Gatekeeper to have to use a workaround to install WxPython, see here.
# Double click on the .dmg install file. # Drag the .pkg file to your work folder # cd to the folder of the .pkg file $ sudo installer -pkg wxPython2.9-osx-cocoa-py2.7.pkg -target / Password: installer: Package name is wxPython2.9-osx-cocoa-py2.7 installer: Installing at base path / 2012-10-04 20:13:25.783 installer[1850:5903] Package /Users/rudi/Install/Utils/wxPython2.9-osx-cocoa-py2.7.pkg uses a deprecated pre-10.2 format (or uses a newer format but is invalid). installer: The install was successful.
Install Winpdb on Mac OS X
This time the installation was easy. Using the Installation hints it works.
$ cd winpdb-1.4.8 $ sudo python setup.py install -f Password: running install running build running build_py creating build creating build/lib copying winpdb.py -> build/lib copying rpdb2.py -> build/lib running build_scripts creating build/scripts-2.7 copying and adjusting winpdb -> build/scripts-2.7 copying and adjusting rpdb2 -> build/scripts-2.7 changing mode of build/scripts-2.7/winpdb from 644 to 755 changing mode of build/scripts-2.7/rpdb2 from 644 to 755 running install_lib copying build/lib/rpdb2.py -> /Library/Python/2.7/site-packages copying build/lib/winpdb.py -> /Library/Python/2.7/site-packages byte-compiling /Library/Python/2.7/site-packages/rpdb2.py to rpdb2.pyc byte-compiling /Library/Python/2.7/site-packages/winpdb.py to winpdb.pyc running install_scripts copying build/scripts-2.7/rpdb2 -> /usr/local/bin copying build/scripts-2.7/winpdb -> /usr/local/bin changing mode of /usr/local/bin/rpdb2 to 755 changing mode of /usr/local/bin/winpdb to 755 running install_egg_info Writing /Library/Python/2.7/site-packages/winpdb-1.4.8-py2.7.egg-info
Prepare target for debug
In order to allow debugging per GUI you have to insert into your Python program:
import rpdb2; rpdb2.start_embedded_debugger('123', fAllowRemote=True)
Winpdb GUI local/remote
The call on the command line (terminal) shows up a window for local debug:
If you want to remote debug your program you have to call:
$ ./winpdb -–host=192.168.17.72
List of pages in this category:
-- RudolfReuter 2012-10-04 18:28:03