ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Query about doing fortran-esque repeat formatting
by Rob Briggs other posts by this author
Nov 8 2009 7:28AM messages near this date
PySiteCreator v0.1 released | Re: Query about doing fortran-esque repeat formatting
Hello, 

Is there a way to do a repeat formatting command like in Fortran? Rather
that doing this:

print "%s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f" %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4],  tmp[i][6],  tmp[i][7],
tmp[i][8],  tmp[i][9])

Something like this:

print "%s 7%-5.3f % (parmName[i], tmp[i][1], tmp[i][2], tmp[i][4],
tmp[i][6],  tmp[i][7], tmp[i][8],  tmp[i][9])

regards, 

Rob

-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Rob Briggs
Mensanator
Glenn Hutchings
Jean-Michel Pichavant
Rob Briggs
Novocastrian_Nomad

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved