Python常用标准库
if not os.path.exists('os'):
os.mkdir('os')
if not os.path.exists('os/test.txt'):
# 自动新建
f = open('os/test.txt','w')
f.write('谁还不是个小宝贝呢?')
f.close()
# 获取两天前的时间
local_timestamp = time.time()
two_dates_before = local_timestamp - 60*60*24*2
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(two_dates_before)))