随笔分类 - pyhton
-
在python中使用cmd命令行
摘要:在python中使用命令行 环境:windows 10 python版本:3.7 import os lists = os.popen('adb devices').read() ip_info = os.popen('ipconfig').read() # 一行一行读取 ip_infos = os 阅读全文
-
python 函数入参指定类型
摘要:from typing import List, Tuple, Dict names: List[str] = ['Germey', 'Guido'] version: Tuple[int, int, int] = (3, 7, 4) operations: Dict[str, bool] = {' 阅读全文
-
查看所在函数名、文件路径、完整信息
摘要:显示函数的名字及相关信息 import inspect def kkklll(): pprint(inspect.stack()) print('***'*35) pprint(inspect.stack()[0][0]) # 文件信息 pprint(inspect.stack()[0][1]) # 阅读全文