摘要:
#! /usr/bin/python import time current_time = time.strftime("%Y-%m-%d %H:%M") print current_time 结果: spdbmadeMacBook-Pro:python spdbma$ ./test.py 2016-03-18 14:42 阅读全文
摘要:
遍历系统中某一目录下的所有文件名 #! /usr/bin/python # coding:utf-8 import os def dirList(path): filelist = os.listdir(path) print filelist dirList('/Users/spdbma/python') 结果: spdbmadeMacBook-Pro:python sp... 阅读全文