Forum: Poser Python Scripting


Subject: Python under Poser 12

Anthony Appleyard opened this issue on Jul 01, 2021 ยท 4 posts


Anthony Appleyard posted Thu, 01 July 2021 at 9:19 AM

Please tell us how to modify existing Poser scripts intended for Poser 11 and before, so that they will run correctly under Poser 12.


HartyBart posted Thu, 01 July 2021 at 5:43 PM

I've no current interest in Poser 12 scripts, and have not tested the following. But there is an official autofixer called 2to3, apparently for automated Python 2 to 3 code translation.Also two others that rely on 2to3. Poser 12 scripters can comment here on if these are useful or not for Poser. Futurize calls in 2to3, and uses it to attempt automatic conversion of Python 2 to Python 3. Python-Modernize also calls in 2to3.

The print and strings commands are different, and the way iterated lists are done. Calling modules now uses lower-case only (e.g. Tkinter = tkinter. And you can't mix intent tabs and spaces in Python 3 scripts.

I guess one of the best ways to learn would be to look at some well-commented Poser 12 / Python 3 scripts, and learn from those. Perhaps we need a fully commented 'Poser 12 demo' script, showing exactly what has changed and how?



Learn the Secrets of Poser 11 and Line-art Filters.


Anthony Appleyard posted Fri, 02 July 2021 at 5:54 PM

Please, how can I download 2to3?


HartyBart posted Sat, 03 July 2021 at 5:30 AM

Typing 2to3 python into a search-engine gets you there.



Learn the Secrets of Poser 11 and Line-art Filters.