摘要: root:PRIMARY> db.currentOp() { "inprog" : [ { "opid" : 6222, #进程号 "active" : true, #是否活动状态 "secs_running" : 3,#操作运行了多少秒 "microsecs_running" : NumberLo 阅读全文
posted @ 2022-06-09 00:21 lucky_tomato 阅读(558) 评论(0) 推荐(0) 编辑
摘要: 指定xlrd版本号,可能是版本太新所以不行 pip install xlrd==1.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 阅读全文
posted @ 2022-06-09 00:20 lucky_tomato 阅读(550) 评论(0) 推荐(0) 编辑
摘要: 指定源 pip3 install xlrd -i https://pypi.tuna.tsinghua.edu.cn/simple 阅读全文
posted @ 2022-06-09 00:18 lucky_tomato 阅读(118) 评论(0) 推荐(0) 编辑
摘要: os.path.getsize() 返回文件的字节数,如果为 0,则代表空。 import os if os.path.getsize('test.txt') == 0: print('这是空文件') 阅读全文
posted @ 2022-06-09 00:17 lucky_tomato 阅读(1878) 评论(0) 推荐(0) 编辑
摘要: import sys def line_file_test(): print(sys._getframe().f_lineno) # 获取当前行号(行数) line_file_test() 阅读全文
posted @ 2022-06-09 00:14 lucky_tomato 阅读(1309) 评论(0) 推荐(0) 编辑
摘要: Python的collections模块中namedtuple结构使用示例 # 命名元组,使得元组可像列表一样使用key访问(同时可以使用索引访问) from collections import namedtuple # test_name任意起的名字 Point = namedtuple('te 阅读全文
posted @ 2022-06-09 00:05 lucky_tomato 阅读(12) 评论(0) 推荐(0) 编辑