这个是什么错误呢?
from datetime import datetime from utils.trans.tools import gen_trans_id def test_trans_tool(): """测试trans包下的tools模块""" id1 = gen_trans_id() print(id1) date = datetime(2015, 10, 2, 12, 30, 45) id2 = gen_trans_id(date) print(id2) if __name__ == '__main__': test_trans_tool()
C:\python-projects\venv\Scripts\python.exe C:/python-projects/utils/test_module.py
Traceback (most recent call last):
File "C:/python-projects/utils/test_module.py", line 16, in <module>
test_trans_tool()
File "C:/python-projects/utils/test_module.py", line 8, in test_trans_tool
id1 = gen_trans_id()
File "C:\python-projects\utils\trans\tools.py", line 15, in gen_trans_id
return datetime.strptime('%Y%m%d%H%M%S%f')
TypeError: strptime() takes exactly 2 arguments (1 given)
Process finished with exit code 1
8
收起
正在回答 回答被采纳积分+1
1回答
1.Python零基础入门
- 参与学习 人
- 提交作业 2727 份
- 解答问题 8160 个
想要进入Python Web、爬虫、人工智能等高薪领域,你需要掌握本阶段的Python基础知识,课程安排带你高效学习轻松入门,学完你也能听得懂Python工程师的行业梗。
了解课程


恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星