which Python version does Plex 0.9.3 installed on a Snow Leopard box use? Does it bring along its own version, or does it use the system frameworks?
A similar question has been asked here: http://forums.plexapp.com/index.php/topic/24243-python-version/ suggesting that Plex ships its own copy of Python. But I think this post is somewhat outdated.
I'm still a newby when it comes to Plex Plugin development, and Python in general. While getting used to the Python string functionality I've noticed that my code won't run when using the Python string "format" function, which according to the Python docs was introduced in Python 3.0 and backported to Python 2.6.x.
A quick check on the default Python command line interpreter reveals that the "format" function (e.g. "hello {0}".format("world") works as expected (whereas the same code would not run inside my Plex Plugin) and indeed:
> python --version
prints out 2.6.
**I am aware that Snow Leopard comes with both Python 2.5 and 2.6 installed**, and printing out the Python version inside my Plugin code reveals that **Plex is indeed using the older Python 2.5**! What's more, I seem to remember that within some debug log statements I saw that something like "/Library/Frameworks/Python25/..." (can't remember the exact path right now) was pulled in, i.e. Plex Media Server (0.9.3) really seems to use the system frameworks.
It is not a big issue and I can as well use the Python % operator to format my strings (see http://stackoverflow.com/questions/5082452/python-string-formatting-vs-format), however **I'm still wondering whether there was this Big Python Switch which would let me choose which Python version to use**.
On OS X, we use the system Python, and always run under Python 2.5 because the media server still runs on Leopard, which doesn’t ship with 2.6. There’s no way for plug-in developers to override this, as we need to ensure that all plug-ins can run on all operating system platforms and versions
Looking to use a Python IDE (Python Tools, http://pytools.codeplex.com/) on Windows. Is the above information on the currently used Python version (2.5) for plug-ins still true today? The DLLs in my PMS Windows installation suggest that it’s using Python 2.6.
Okay thanks. For the sake of creating a generic plug-in, should one still use 2.5? The minimum requirement for PMS on OS.X is now Snow Leopard, what is being used there? Taking that only PMS Python support matters here?
I’m not sure it will matter which you choose for the IDE to be honest, but 2.5 will probably be safe to use. The objective is to not bring in any external libraries and use what’s in the framework itself so it shouldn’t really matter in the IDE if you’re not importing anything. Just guessing as I honestly just use a text editor, I haven’t used a Python IDE in years.
I do realize that this is the least of my problems… gotta learn some Python and more importantly the Plex plugin framework (which I am so far not finding very well documented).