[GRASS-dev] grass.info versus print

Paulo van Breugel p.vanbreugel at gmail.com
Mon Apr 11 07:04:01 PDT 2016


Hi, I am working on a script in which I want to provide the output
formatted in three columns. I can use

nlength = 20
RES = [MAPy, vif, sqrtvif]
print '{0[0]:{1}s} {0[1]:8.2f} {0[2]:8.2f}'.format(RES, nlength)

This prints nicely on the command line. However, on the command output tab
of the GUI, the order of the printed lines is messed up.

If I use instead:

nlength = 20
RES = [MAPy, vif, sqrtvif]
grass.info('{0[0]:{1}s} {0[1]:8.2f} {0[2]:8.2f}'.format(RES, nlength))

It looks good on the command output tab, but it is printed without the
fixed width.

Is there a way to make to print text in multiple columns both on the
command line and the command output tab of the addon GUI?

Paulo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160411/008a28e0/attachment.html>


More information about the grass-dev mailing list