Forum: Poser Python Scripting


Subject: Py2 to Py3 conversions

structure opened this issue on Nov 08, 2020 ยท 6 posts


structure posted Sun, 08 November 2020 at 10:31 AM Forum Coordinator

A thread to assist in the conversion of python 2 to python 3. Anything you come across that you have found a conversion for can be placed in this thread. examples

python 2 : 
print x 
Python 3:
print( x )

python2 
wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
python3:
wx.SystemSettings().GetFont(wx.SYS_DEFAULT_GUI_FONT)

python2:
outfile.write( "[advanced]" + "\n")
python3:
outfile.write( bytes("[advanced]" + "\n"), encoding = 'utf8' )

Locked Out