Skip to content

Instantly share code, notes, and snippets.

@gmyou
Created August 22, 2013 09:01
Show Gist options
  • Save gmyou/6304800 to your computer and use it in GitHub Desktop.
Save gmyou/6304800 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3.3
import os
term = "food"
#path = "./"+term+"/ca/"
path = "./"+term+"/ca/"
dirList = os.listdir(path)
fnumList = {}
fsize_tmp = 0
for fname in dirList:
if (fname.endswith(".json")):
fsize = os.path.getsize(path+fname)
fnum = fname.replace(term+"_ca_", "")
fnum = fnum.replace(".json", "")
#if (fsize>271):
if (fsize>271 and int(fnum)<1806):
fnumList[int(fnum)] = fsize
for key in sorted(fnumList.iterkeys()):
if (fsize_tmp != fnumList[key]):
print key, fnumList[key]
fsize_tmp = fnumList[key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment