tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/2223-help-with-python-scriptInfinite Kind: Discussion 2019-01-10T21:50:24Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/462445992018-10-11T21:15:14Z2018-10-11T21:15:14ZHelp with Python script<div><p>@SteveH42,</p>
<p>For this discussion purpose, string.upper(xxx) will only work if xxx is a string type. In the second case, sacct_type (the argument) is not a string type. Likely, Account.AccountType</p>
<p>I think what you want to do is replace<br>
<code>if string.upper(sacct_type)=='EXPENSE':</code></p>
<p>with</p>
<pre>
<code> if sacct_type == Account.AccounType.EXPENSE:</code>
</pre>
<p>I have not actually test above code.</p></div>hleofxquotestag:infinitekind.tenderapp.com,2009-01-14:Comment/462445992018-10-11T21:43:35Z2018-10-11T21:43:35ZHelp with Python script<div><p>Hi @hleofxquotes</p>
<p>Many thanks, just a slight typo in your example but</p>
<p>if sacct_type == Account.AccountType.EXPENSE:</p>
<p>works a treat!</p>
<p>Thanks again.</p></div>SteveH42