Forum: Poser Python Scripting


Subject: Using Eclipse with Poser -- how to import Poser module

Amadan opened this issue on Apr 12, 2009 · 4 posts


Amadan posted Sun, 12 April 2009 at 12:25 AM

I'm just getting started with PoserPython. I'm an experienced programmer, but fairly new to Python and completely new to PoserPython.

I've read the tutorial on using the IDLE debugger from within Poser, but I'm wondering whether anyone has tried using Eclipse's Pydev in conjunction with Poser? I'd like to use the Eclipse debugger.

Where is the Poser module located? I can't seem to find it anywhere in Poser's file structure, so I am guessing it is a binary accessed internally by the application?


nruddock posted Sun, 12 April 2009 at 4:56 AM

Quote - Where is the Poser module located?
I can't seem to find it anywhere in Poser's file structure, so I am guessing it is a binary accessed internally by the application?

You're correct, it's inside the Poser executable, and isn't available to external tools.

Have you managed to get idle working from within Poser, if so which version ?
Everything I've tried points to threading not working.


adp001 posted Sun, 12 April 2009 at 5:11 AM

IDLE is not a debugger. It's an IDE for Python, able to set Breakpoints used with Python modul pdb (yes, the debugger is simply a standard Python modul).

Eclipse does exactly the same.

Check http://docs.python.org/library/pdb.html for a description of pdb.

<pre style="padding:.5em;margin-left:2em;background-color:rgb(224,224,224);color:rgb(0,0,0);">

pdb.py can also be invoked as a script to debug other scripts.  For example:

<strong>python -m pdb myscript.py</strong>

When invoked as a script, pdb will automatically enter post-mortem debugging if the 
program being debugged exits abnormally. After post-mortem debugging (or after normal 
exit of the program), pdb will restart the program. Automatic restarting preserves 
pdb’s state (such as breakpoints) and in most cases is more useful than quitting the 
debugger upon program’s exit. 
  

You are right: Posers Python lib is a static piece of code once loaded if Poser is started. There is no re-initializing or reloading, exept if you request "reinitialize Python" from Posers Menu.

Edit:

Don't forget to check http://docs.python.org/library/bdb.html. Modul bdb is used to handle Pythons breakpoints and such.




Amadan posted Sun, 12 April 2009 at 2:39 PM

Yeah, I know IDLE is an IDE -- I meant I wanted to be able to debug a PoserPython script as it runs from within Poser. Apparently this can be done with IDLE, if you follow the tutorial instructions to make it run within Poser, which I haven't done yet since it seems to require using an older version of Python. I was hoping it might be possible to do the same with Eclipse.

As an IDE, Eclipse is a lot more convenient since I can just link my Pydev project to the PoserPython file structure, and Eclipse is much more full-featured than IDLE. But I guess I'll have to do debugging the hard way. Ah well.