摘要:
Donn Lee Python CookbookQuick and easy ways to get python to do what you want it to do.Get the size (in bytes) of a fileFILE = '/home/donn/postip/log.txt'try:filesize = os.path.getsize(FILE)except:print "Error getting size of file %s." % FILEsys.exit()if filesize > 5000000:print 阅读全文