GODOT IS OPEN SOURCE
This commit is contained in:
parent
0e49da1687
commit
0b806ee0fc
3138 changed files with 1294441 additions and 0 deletions
36
tools/memsort.py
Normal file
36
tools/memsort.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
import sys
|
||||
|
||||
arg="memdump.txt"
|
||||
|
||||
if (len(sys.argv)>1):
|
||||
arg=sys.argv[1]
|
||||
|
||||
f = open(arg,"rb")
|
||||
|
||||
|
||||
l=f.readline()
|
||||
|
||||
|
||||
sum = {}
|
||||
cnt={}
|
||||
|
||||
|
||||
while(l!=""):
|
||||
|
||||
s=l.split("-")
|
||||
amount = int(s[1])
|
||||
what=s[2]
|
||||
if (what in sum):
|
||||
sum[what]+=amount
|
||||
cnt[what]+=1
|
||||
else:
|
||||
sum[what]=amount
|
||||
cnt[what]=1
|
||||
|
||||
l=f.readline()
|
||||
|
||||
|
||||
for x in sum:
|
||||
print(x.strip()+"("+str(cnt[x])+"):\n: "+str(sum[x]))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue