摘要:
3 print(time.time()) # 时间戳:1487130156.419527 4 print(time.strftime("%Y-%m-%d %X")) #格式化的时间字符串:'2017-02-15 11:40:53' # 把一个格式化时间字符串转化为struct_time。实际上它和strftime()是逆操作。 20 print(time.strptime('2011-... 阅读全文
摘要:
os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname") 改变当前脚本工作目录;相当于shell下cd os.curdir 返回当前目录: ('.') os.pardir 获取当前目录的父目录字符串名:('..') os.makedirs 阅读全文