tag:infinitekind.tenderapp.com,2009-01-14:/discussions/suggestions/12825-please-change-moneybot-console-to-use-a-fixed-width-fontInfinite Kind: Discussion 2019-11-20T15:40:22Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/475453242019-08-21T15:37:13Z2019-08-21T15:37:14ZPlease change MoneyBot Console to use a fixed-width font<div><p>Hello,</p>
<p>This is a minor issue but it might cause other noobs considerable frustration like it did me.</p>
<p>I'm new to Python and was trying to get some MoneyBot console script output to appear in a tabular format with the numbers in each column right-aligned. No matter what I tried, I couldn't get python to right-justify the columns in my tabular output (using python's print/format feature)</p>
<p>The problem turned out to be that the default font used in the MoneyBot console window has proportional-width characters rather than fixed width characters. This means that even though my output was properly converted to fixed-width strings that were properly right-justified, when each output line is rendered in the console window, different characters use a different amount of space and this causes the output to be misaligned.</p>
<p>If I cut/paste the console window output from my script to another editor that uses a fixed width font, each line renders in the editor with all data perfectly right-aligned in nice neat columns as I originally intended.</p>
<p>Here's the python code that produced the output:<br>
print (' {0:s}\t${1:.2f}\t{2:<em>>12,.2f} \t{3:</em>>12,.2f}\t{4:*>12.2f}'. format(l.date.strftime("%m/%d/%y"),l.buyPrice,l.availableShares,l.costBasis,l.currentPrice))</p>
<p>I think it might be better if the default font in the console output window was a fixed-width font so tabular output will render with the intended alignment.</p>
<p>Thanks!</p></div>magellantag:infinitekind.tenderapp.com,2009-01-14:Comment/475453242019-08-21T15:39:18Z2019-08-21T15:39:18ZPlease change MoneyBot Console to use a fixed-width font<div><p>The attachments seemed to get lost...</p></div>magellan