python ValueError: Invalid format string-time.localtime())
File "D:/PycharmProjects/pythonProject_file_operation/main_file_op.py", line 14, in add_to_log
time2 = time.strftime('%Y-%m-%d %H:%M:%s', time.localtime())
ValueError: Invalid format string
%s,s小写,语法错误
改为大写:
time2 = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
欢迎讨论,相互学习。
cdtxw@foxmail.com