Getting PythonWin debugger working with an embedded app.

Stidolph, David stidolph at origin.ea.com
Mon Nov 22 10:12:03 EST 1999


I am trying to get the Python Win debugger working with our app.  We have
embedded Python and using it as a script language.  We are using the debug
version of the Python DLL for Windows.

I copied the pywin directory to our python system directory (plus adding
that to the search path) and put the following code in one of our scripts
(to be activated from a menu item within our ui):

import pywin.debugger
try:
    a = 1 / 0
except:
    pywin.debugger.post_mortem()

I get the following output:

Traceback (innermost last):
  File "python\client\Interface\UIMenu.py", line 272, in DoMenuCommand
    command(x,y,flags)
  File "python\client\Interface\UO2GameWindow.py", line 304, in OnMenuDebug
    pywin.debugger.post_mortem()
  File "C:\Program Files\Python\Pythonwin\pywin\debugger\__init__.py", line
70, in post_mortem
    p = _GetCurrentDebugger()
  File "C:\Program Files\Python\Pythonwin\pywin\debugger\__init__.py", line
9, in _GetCurrentDebugger
    import debugger
  File "C:\Program Files\Python\Pythonwin\pywin\debugger\debugger.py", line
19, in ?
    import win32ui
ImportError: No module named win32ui

I tried putting the contents of the PythonWin directory in the pywin
directory and it still has the same message.
In looking at the message I see that it is going to the installed place of
Python and PythonWin instead of my search path.  I can see the win32ui.py
module, and it is directly in the Python search path, so what am I doing
wrong?

Any advice or suggestions would be truly welcome.  Getting the debugger
working would be a huge step forward for us.


Thanks for you help,

David.






More information about the Python-list mailing list