tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/1701-python-3-and-ktinterInfinite Kind: Discussion 2018-10-18T14:07:19Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-12T11:54:21Z2016-11-12T11:54:21ZPython 3 and ktinter<div><p>I'm trying to write an extension using Python 3 and the ktinter
module. However when I run it in the Python Interpreter I get the
following error message:</p>
<p>Error running script: Traceback (most recent call last):<br>
File "C:\Users\2M\Desktop\Program ming\Moneydance Window.py", line
1, in from tkinter import * ImportError: No module named
tkinter</p>
<p>Is there any way I can proceed?</p></div>Mike Enochtag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-12T21:32:57Z2016-11-12T21:32:57ZPython 3 and ktinter<div><p>Hi Mike,</p>
<p>Ah yes, tkinter won't be available since the Python interpreter
used in Moneydance is Jython - the java-based interpreter. My
understanding is that the tk library isn't available on the Jython
platform. If that's not true please let me know and I can look into
ensuring that the tkinter libraries can be bundled with the next
update.</p>
<p>Thanks!<br>
Sean</p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-14T13:21:42Z2016-11-14T13:21:42ZPython 3 and ktinter<div><p>Thanks for the info. You're correct the tk library isn't
available on Jython.</p>
<p>So it's back to the textbooks and another learning curve for me
to climb!</p></div>Mike Enochtag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-14T15:53:26Z2016-11-14T15:53:26ZPython 3 and ktinter<div><p>Yes, sorry about that. Please let me know though what kind of UI
interface would be use. We do need to keep it cross-platform, but
maybe something like simple HTML would be useful?</p>
<p>We're also working on an interface to interface with user
authentication/authorisation such as for online banking logins, in
case that's what you're looking for.</p>
<p>Thanks,<br>
Sean</p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-15T12:27:47Z2016-11-17T17:55:36ZPython 3 and ktinter<div><p>I'm attempting to write an extension (basically for my own
use<br>
initially) that would list all Transaction Reminders in a
table,<br>
showing:</p>
<p>Start Date; Payee; Last Date Paid; Next Date Due; Amount; From
Account;<br>
To Account.</p>
<p>When particular line is clicked the Edit Transaction Reminder
Form<br>
should be displayed. On closure the table would be refreshed.</p>
<p>I've got many years experience of Microsoft Visual Basic and
have a<br>
limited knowledge of Python, so Jython and Swing are very new to
me.<br>
(I've ordered books!!)</p>
<p>Would you be able to give me advice on the code required to
display the<br>
edit-reminders window.</p></div>Mike Enochtag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-17T17:58:00Z2016-11-17T17:58:00ZPython 3 and ktinter<div><p>Edit Transaction Reminder</p></div>Mike Enochtag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-17T20:38:59Z2016-11-17T20:38:59ZPython 3 and ktinter<div><p>Hi Mike,</p>
<p>Great question. This is currently only accessible with the
following code:</p>
<pre>
<code>from com.moneydance.apps.md.view.gui import EditRemindersWindow
reminders = moneydance_data.getReminders()
reminder = reminders.getAllReminders()[0]
EditRemindersWindow.editReminder(None, moneydance_ui, reminder)</code>
</pre>
<p>I'll add a more formal interface to do something like this to a
future version.</p>
<p>Thanks!</p>
<p>Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="http://infinitekind.com">http://infinitekind.com</a></p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-19T19:23:15Z2016-11-19T19:23:15ZPython 3 and ktinter<div><p>Thank you for the code.</p>
<p>I've now got most of the extension sorted but I can't see how to
get the Account Name that the funds, for each Transaction Reminder,
are taken from.</p>
<p>Any advice most welcome.</p></div>Mike Enochtag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-19T19:40:18Z2016-11-19T19:40:18ZPython 3 and ktinter<div><p>Hi Mike,</p>
<p>Ah, to get the account for the transaction reminder you’ll
just need to call .getTransaction() on the reminder to get a
ParentTxn object. On the parent transaction you can call
.getAccount() to get the account object that contains that
transaction, and then getOtherTxn(i).getAccount() for
i=[0…txn.getOtherTxCount()).</p>
<p>Thanks! Sean</p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/412120692016-11-28T19:42:13Z2016-12-16T20:47:58ZPython 3 and ktinter<div><p>Could you advise me how to show the Reminder Notification
window?</p>
<p>Thanks</p>
<p>Mike</p></div>Mike Enoch