摘要:
一 时间格式转字符串 # 第一种日期格式 t1 = datetime.datetime.now() t1Str = t1.strftime("%Y-%m-%d %H:%M:%S") print(t1Str) # 2022-06-10 16:31:34 # 第二种日期格式 t2 = time.loca 阅读全文
摘要:
一 .join(iterator),后面必须是可迭代对象,例如:字符串,列表,元组 testList = ["1","2"] print(",".join(testList)) #输出 1, 2 idStr = "abcedf" print(",".join(idStr)) #输出 a, b, c, 阅读全文
摘要:
一 建立mongo连接 from pymongo import MongoClient from bson import ObjectId host = "host" username = "username" password = "password" database = "database" 阅读全文