随笔分类 - python
摘要:>>> psutil.pids() # 所有进程ID [3865, 3864, 3863, 3856, 3855, 3853, 3776, ..., 45, 44, 1, 0] >>> p = psutil.Process(3776) # 获取指定进程ID=3776,其实就是当前Python交互环境
阅读全文
摘要:安装 pip install configparser 1 配置文件 config.ini: [MysqlDB]user=rootpasswd=123456sport=3306db_name=my_dbcharset=utf-8 获取参数: import configparser config =
阅读全文
摘要:xlwings: xlwings是一个Python库,它使Python的一些数据分析特性可以在Excel实例中使用,包括对numpy数组、pandas Series和DataFrame的支持。与其他任何Python库一样,我们可以使用pip或conda等常用方法来安装它。详细文档(https://w
阅读全文
摘要:使用国内源进行下载: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn pandas
阅读全文
摘要:报错: Cannot unpack file C:\Windows\TEMP\pip-unpack-4mbfczpj\simple (downloaded from C:\Windows\TEMP\pip-req-build-66uynkdi, content-type: text/html; ch
阅读全文
摘要:cpu disk mem import osimport psutilos.chdir(os.getcwd()) #cpu def get_cpu_info(): cpu_percent=psutil.cpu_percent(interval=1) cpu_info="used cpu perenc
阅读全文
摘要:zookeeper的增 删 改 查 watch监听。 from kazoo.client import KazooClient import time,os import timeit os.chdir(os.getcwd()) def connection(): zk=KazooClient('l
阅读全文
摘要:Python 2.7.9 + 或 Python 3.4+ 以上版本都自带 pip 工具。 pip 官网:https://pypi.org/project/pip/ 你可以通过以下命令来判断是否已安装: 如果你还未安装,则可以使用以下方法来安装: 注意:用哪个版本的 Python 运行安装脚本,pip
阅读全文

浙公网安备 33010602011771号