Debugging python code

Discussions concerning programming of SOFTIMAGE©
Post Reply
houGenie
Posts: 9
Joined: 02 Feb 2021, 22:24

Debugging python code

Post by houGenie » 15 Feb 2021, 11:06

Hi si-community.
I am trying to build some plugins for softimage with python. Because the logic of my scripts gets quite complex I wanted to debug my code with pythonwin. But unfortunately it does not work.

Some infos about my configuration:
- softimage 2015 SP2
- pythonwin 2.7.3
- python version 2.7
- using the buildin softimage python (it is set in the preferences)

What I am doing to start debugging:
- writing code in the script editor and inserting the breakpoint code
Image
- running the code
- the pythonwin window popups
Image

As you see in the first pic there is an error "OverflowError: Python int too large to convert to C long". What does it mean? Is there a version mismatch? Should I enter something into the pythonwin immediate window (if I try it throws errors)? Please help me. I did not find any infos for this issue, and infromations are really rare. Thank you!

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Debugging python code

Post by Hirazi Blue » 15 Feb 2021, 16:18

This appears to be a bug in Pywin32 regarding 64 bit...
In this thread there is a proposed workaround by "panda" for another version of pywin which involves editing the "debugger.py"-file in
"Program Files\Autodesk\Softimage 2015 R2-SP2\Application\python\Lib\site-packages\pythonwin\pywin\debugger"
Note: this solution seems to be for a different version of Pywin32, but I just tested it and it seems to do the trick with built-in-Python on Softimage...
pywindebug.png
Stay safe, sane & healthy!

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Debugging python code

Post by Hirazi Blue » 15 Feb 2021, 16:37

After exiting the debugger, however, I wasn't able to restart the debugger in the same Softimage session again and had to restart Softimage to try again... :-?
Stay safe, sane & healthy!

houGenie
Posts: 9
Joined: 02 Feb 2021, 22:24

Re: Debugging python code

Post by houGenie » 15 Feb 2021, 22:16

Ah thank you! I installed python 2.7.18 and pywin 228 64 Bit, and now it works without errors (it seems). I am not sure that the versions will not mess with softimage, we will see. Have also problems with the pywin sessions, only restart of softimage helps. Another problem is, that in pywin I see only the immediate window and there only the current line of the code. How can I debug through my code visually? When I load the file and run the script in pywin it works as expected, but then it is not linked to softimage and all objects (like Application) are unknown.

Post Reply

Who is online

Users browsing this forum: No registered users and 58 guests