summaryrefslogtreecommitdiff
path: root/Demo/scripts/ftpstats.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2007-08-06 21:07:53 +0000
committerSkip Montanaro <skip@pobox.com>2007-08-06 21:07:53 +0000
commit1e8ce58f5d0db22714d65ff440045a7526ed394d (patch)
treef705fb923334cffa32492a5bddfcca46ecc27f0a /Demo/scripts/ftpstats.py
parent28a181cbe82bc79df3b881b79b19e12b2e39911b (diff)
downloadcpython-git-1e8ce58f5d0db22714d65ff440045a7526ed394d.tar.gz
remove most uses of list(somedict.keys()) in Demo scripts
Diffstat (limited to 'Demo/scripts/ftpstats.py')
-rwxr-xr-xDemo/scripts/ftpstats.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Demo/scripts/ftpstats.py b/Demo/scripts/ftpstats.py
index d0a08249dc..19ad3928cc 100755
--- a/Demo/scripts/ftpstats.py
+++ b/Demo/scripts/ftpstats.py
@@ -106,9 +106,7 @@ def showbar(dict, title):
n = len(title)
print('='*((70-n)/2), title, '='*((71-n)/2))
list = []
- keys = list(dict.keys())
- keys.sort()
- for key in keys:
+ for key in sorted(dict.keys()):
n = len(str(key))
list.append((len(dict[key]), key))
maxkeylength = 0
@@ -128,8 +126,7 @@ def show(dict, title, maxitems):
n = len(title)
print('='*((70-n)/2), title, '='*((71-n)/2))
list = []
- keys = list(dict.keys())
- for key in keys:
+ for key in dict.keys():
list.append((-len(dict[key]), key))
list.sort()
for count, key in list[:maxitems]: