Python 3 support

robert.stickney's Avatar


29 Oct, 2021 10:47 PM

Hi is there a plan to support python 3 for scripts and extensions?
Python 2 is not supported any more.

  1. 1 Posted by Stuart Beesley ... on 30 Oct, 2021 04:27 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I doubt it... MD is providing Jython (not Python) which is based on PY2.7.... This is a Java codebase so that it can access MD Java APIs.. There is nothing newer than JY2.7..

    out of interest, is there anything in PY3 that you've found you cannot do in PY2?

  2. 2 Posted by dalefurrow (Fel... on 30 Oct, 2021 07:52 PM

    dalefurrow (Fellow User)'s Avatar

    So it's possible to gain access to the root directory in a roundabout way in python3, and I have documented that here. (Use at your own risk, be sure to backup your data).

    That's pretty much how I access MD these days...the only thing I still use the app for is downloading and reconciling bank accounts, manual and automated transaction entry. Everything else (downloading of investment transactions, security prices, all reporting functionality) I run through python.

    In response to Stuart, most of the important python packages for any sort of data manipulation (numpy, pandas, spark, etc), cloud computing (aws, azure) are no longer supporting py2, and my clients don't want unsupported base packages underneath code I write for them, so that pretty well forced the switch for me. At least for me, using jpype as detailed above to get at the data works well enough for now.

  3. 3 Posted by robert.stickney on 31 Oct, 2021 06:36 PM

    robert.stickney's Avatar

    My main point is that I find it bad practice to use unsupported software. While Jython is "supported" the python community no longer supports version 2.7. The continuation of using Jython seems like a way to pretend that a section of your software is not stale.

  4. 4 Posted by robert.stickney on 31 Oct, 2021 06:57 PM

    robert.stickney's Avatar

    Oh and I forgot to add: Thank you Dale. While i did run across jpyp, I am very grateful that you made this tutorial!

  5. 5 Posted by Stuart Beesley ... on 31 Oct, 2021 07:11 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    FYI - using Dale's original scripts (thanks Dale!), I made some tweaks that allow access using JPype and also Jython, with the passing of the passphrase too...

    Examples at the end of my site:

  6. 6 Posted by dalefurrow (Fel... on 31 Oct, 2021 07:13 PM

    dalefurrow (Fellow User)'s Avatar

    Ah, that's right--Thanks Stuart. I was gonna add that to the repo, haven't got to it yet.

  7. 7 Posted by Stuart Beesley ... on 31 Oct, 2021 07:58 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    PPS - I just tried my scripts on the latest versions of MD/Java and not working.... Will have to investigate....

  8. 8 Posted by Stuart Beesley ... on 01 Nov, 2021 01:36 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I just reverified my scripts. The ones that access MD headless via Jython all work perfectly. My JPype script (variant of yours) that allows you to feed a specific password is also ok. The one using JPype and setting the environment variable is no longer working… something to do with the UI trying to load (which works fine with Jython, not JPype)… oh well.

  9. System closed this discussion on 31 Jan, 2022 01:40 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac