Last active
August 29, 2015 14:19
-
-
Save KoaxialKable/2761845aaf82b4477cf9 to your computer and use it in GitHub Desktop.
Just a quick peek at some of the string formatting options available in Python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for row in curs.fetchall(): | |
print('{Name:<21} {Amount:>17,.2f} {AvgAmount:>18,.2f} {NumTimes:>12}'.format( | |
Name = row[0], | |
Amount = row[1], | |
AvgAmount = row[2], | |
NumTimes = row[3] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment