Skip to content

Commit bc26cac

Browse files
committed
Choose output format at command line
1 parent a8dd29f commit bc26cac

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dictresize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import itertools
2+
from sys import argv
23
from sys import getsizeof as memsize
34

45

@@ -54,7 +55,7 @@ def get_size_format(name):
5455

5556

5657
if __name__ == '__main__':
57-
format_name = 'full'
58+
format_name = argv[1]
5859
display_sizes(get_size_format(format_name))
5960
print('') # support 2.7
6061
display_resizes(get_resize_format(format_name))

dictresize.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
for version in 2.7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12
44
do
5-
python$version dictresize.py > results$version.txt
5+
python$version dictresize.py $1 > results$version.txt
66
done

0 commit comments

Comments
 (0)