Forum: Poser Python Scripting


Subject: Debugging Poser Python with PoserPro2010 (it works :)

xuu4u opened this issue on Mar 27, 2010 · 4 posts


xuu4u posted Sat, 27 March 2010 at 5:01 PM

Since some days i have PPro2010. I was interested to test wether debugging python code via IDLE is possible under PoserPro2010. The Python version in PoserPro is still Version 2.4.2. So i installed the IDLE Version from the Python 2.2.3 Package. (There is a tutorial of mine in the Poser Tutorials Forum Section how to do this, Search for "IDLE" ) And woha, it works good. i had no more errormsges when closing the IDLE windows. and there was no problem to restart it too.

greetings
xuu4u



xuu4u posted Mon, 29 March 2010 at 10:25 AM

 Doing some analysis with the integradted IDLE of PoserPro 2010 i found out how to modifiy it,
so it doesnt carsh poser anymore.

The problem that crashes poser has to do with the subprocess for the debugger window.
Theres a lot of code that hast to do with the subprocess and i dont wanna step
in the the details deeper.

to fix this you have to make small change in the file pyshell.py
(if you need a good code editor, try Notepad++, it supports python code
you will find it easyly via google)

To Fix it open 
'Your Poser8 / PoserPro2010 Installation"
runtimepythonlibidlelibpyshell.py

Line 1272 : use_subprocess = True
Replace True to False and save the file.

To Try out open 
'Your Poser8 / PoserPro2010 Installation"
runtimepythonposerscriptsmainbuttons.py

and change for example line 9 to the following
poser.DefineScriptButton(7, ":Runtime:Python:Lib:idlelib:idle.py", "IDLE 1.1.2")

you can then start idle via the Poser Python Scripts Buttons.

Bcause we use IDLE with the No_Subprocess options now
the debugger doesnt follow automticly the codelines if you step or trace through the code.

if you want that feature, you should use the older version (IDLE 0.8 out of the Python 2.3.3 distribution)

greetings 
xuu4u

 



RobynsVeil posted Sat, 03 December 2011 at 2:38 AM

Is there any documentation on how to use the debug features of IDLE? Or is it all about setting 'print' statements?

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


face_off posted Wed, 05 August 2015 at 12:23 AM

I just tested this on PoserPro2014, and copying the C:/Python27/Lib/idlelib folder into C:/Program Files/Smith Micro/Poser Pro 2014/Runtime/Python/Tools and making the use_subprocess change works!  So thank you!

Unfortunately I could debug a PoserPython Addon, since the are initiated from within Poser rather then the IDLE editor.

Paul

Creator of PoserPhysics
Creator of OctaneRender for Poser
Blog
Facebook