[祖傳代碼] 獲取當前時間(日期)字符串

Python 3 代碼片python import time dateStr = time.strftime('%Y%m%d', time.localtime(time.time())) print(dateStr) 經常使用於給文件和目錄命名。這裏順手檢查目錄是否存在,不存在就創建目錄:web import os localDir = "xxxxx" if not os.path.exist
相關文章
相關標籤/搜索