Forum: Poser Python Scripting


Subject: from __future__ import print_function & other Python 3 compatibility issues

an0malaus opened this issue on Aug 12, 2019 ยท 2 posts


an0malaus posted Mon, 12 August 2019 at 7:20 AM

Since virtually all of my Python experience has been within the realm of Poser (with the exception of uncompyle explorations), I am less than comfortably familiar with the differences between 2.7 & 3.x. I see others who appear to religiously future-proof their code by adopting the python 3 style print() function, rather than the 2.x era print statement, but are there many other gotchas that are likely to bite us when [ahem, h*ck-ptooie] the new devs catch a whiff of that new kool-aid and shoehorn Python 3 up Poser's back passage/addons framework?



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


adp001 posted Mon, 12 August 2019 at 12:59 PM

I'm using the print function with 2.7 since it is available. Reason: In (old) 2.7 "print" is a statement. It can not be used in an expression. Think of something like this:

print("Enough") if a >10000 else make_more_money() #:)


If Poser changes to 3.x, lots of old scripts should go down (even newest Cinema 4D is still with 2.7 for the same reason). I think Poser will stay with 2.7 for the next few [years|centuries]. What I hope for: A recent version of wxPython. Working with graphics within the actual implementation is a pain in the ass.