jython access to md outside MoneyBot Console

David Cullen's Avatar

David Cullen

Jan 24, 2020 @ 05:21 AM

I'm self-taught on python/jython and still have a lot to learn!
I've successfully used MoneyBot Console to run jython/python scripts to access md.
I'm now trying to access my md data outside MoneyBot Console using PyCharm because of its extra features.
I've downloaded and installed standalone jython and confirmed it is working okay. However, when I try:

root = moneydance.getCurrentAccount()
I get an error:
NameError: name 'moneydance' is not defined
What am I not doing?
PS I run Mac OSX if that makes any difference to the solution.
  1. 1 Posted by hleofxquotes on Jan 27, 2020 @ 08:06 PM

    hleofxquotes's Avatar

    I'm now trying to access my md data outside MoneyBot Console using PyCharm because of its extra features.

    David,
    That won't work. Someone needs to create (define) the 'moneydance' object before you can access it.
    When you run inside 'MoneyBot Console', MD itself created the 'moneydance' object.

    Roughly

    moneydance starts  
    opens data file  
    creates Python Interpreter  
    creates moneydance object and make it visible to the Python intepreter  
    NOW python code can have access to MD data via the 'moneydance' object  
    ...
    

    When you just run using PyCharm, all those steps are not happening thus the error
    NameError: name 'moneydance' is not defined

  2. System closed this discussion on Apr 27, 2020 @ 08:10 PM.

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

Keyboard shortcuts

Generic

? 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