import re,datetime#...anniudizuoshan/anniudizuoshan.pvr.ccz" rc=15 ID=12 116 x 256 @ 32 bpp => 116 KBdef action(): file_name = '/Users/jiangxf/Desktop/funstone/log2.txt' file = open(file_name,'r') data = {} a = 0 for (num,line) in enumerate(file): m = re.search(r'^.*\/(.*)\..* (.*) KB$',line) if m: b = m.group(2) if b: a += int(b) # print(num) # print(m.group(1)) data[m.group(1)] = int(b) a = a / 1024 print (a," MB") data = sorted(data.items(),key = lambda x: x[1],reverse = True) #print (data) for k,v in enumerate(data): print k,v file.close()if __name__ == '__main__': action()
--sharedTextureCache:dumpCachedTextureInfo() --cc.TextureCache.dumpCachedTextureInfo() local s =cc.Director:getInstance():getTextureCache():getCachedTextureInfo() print(s) local path_ = CCfileUtils:sharedfileUtils():getWritablePath().."/out.txt" print(path_) local f = io.open(path_,"w+") f:write(s); f:close();总结
以上是内存溢出为你收集整理的cocos统计内存的 py 脚本全部内容,希望文章能够帮你解决cocos统计内存的 py 脚本所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)