Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

number pretty print updated

  • Loading branch information...
commit 85990aa69465b68fae2cfcd8d0a217919411a866 1 parent de18d9c
Jabba Laci authored

Showing 1 changed file with 9 additions and 6 deletions. Show diff stats Hide diff stats

  1. +9 6 wordpress/wordpress.py
15 wordpress/wordpress.py
... ... @@ -1,9 +1,12 @@
1 1 #!/usr/bin/env python
2 2
3   -from jabbapylib.web.web import get_page
4   -from jabbapylib.web.scraper import bs
5   -from jabbapylib.number.number import number_to_pretty_string
6   -from jabbapylib.console import color
  3 +from jabbapylib.web.web import get_page #@UnresolvedImport
  4 +from jabbapylib.web.scraper import bs #@UnresolvedImport
  5 +from jabbapylib.console import color #@UnresolvedImport
  6 +
  7 +# pretty print numbers
  8 +import locale
  9 +locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
7 10
8 11 blogs = ['pythonadventures', 'ubuntuincident']
9 12
@@ -21,13 +24,13 @@ def visit(blog, dic):
21 24 def print_result(dic):
22 25 summa = 0
23 26 for key in sorted(dic.keys()):
24   - print '{blog:40}{hits:>10}'.format(blog=key, hits=number_to_pretty_string(dic[key]))
  27 + print '{blog:40}{hits:>10n}'.format(blog=key, hits=dic[key])
25 28 summa += dic[key]
26 29 #
27 30 print '-' * (40+10)
28 31 print '{total} number of visits: {hits}!'.format(
29 32 total=color.bold('Total'),
30   - hits=color.bold(number_to_pretty_string(summa))
  33 + hits=color.bold('{0:n}'.format(summa))
31 34 )
32 35
33 36

0 comments on commit 85990aa

Please sign in to comment.
Something went wrong with that request. Please try again.