摘要: 结论: performance: marshal > cPickle > json > pickle >>> timeit.timeit("pickle.dumps([1,2,3])","import pickle",number=10000) 0.2939901351928711 >>> time 阅读全文
posted @ 2021-11-29 17:54 春树&暮云 阅读(94) 评论(0) 推荐(0)
摘要: 方法 临时方法 pip install pythonModuleName -i https://pypi.douban.com/simple 永久修改 方式1 修改~/.pip/pip.conf: [global] index-url = https://pypi.douban.com/simple 阅读全文
posted @ 2021-11-29 17:36 春树&暮云 阅读(388) 评论(0) 推荐(0)
摘要: # 需求 使用iguge插件访问google # 步骤 1. 访问 https://iguge.xyz/ 下载离线版iGuge Helper, 注意下载IGG离线安装器 2. 解压下载的包,添加到google拓展程序 3. 基于添加的拓展程序安装器,安装iGuge到拓展程序 4. 可正常访问goog 阅读全文
posted @ 2021-11-29 14:50 春树&暮云 阅读(255) 评论(0) 推荐(0)
摘要: 需求 ubuntu系统以非root开机自动挂载外接磁盘 步骤 查看外接磁盘UUID 方式1: 使用Ubuntu系统自带的磁盘工具 "磁盘" 查看磁盘UUID 方式2: sudo fdisk -l 编辑/etc/fstab sudo vim /etc/fstab UUID=02901fxxxxxx / 阅读全文
posted @ 2021-11-29 14:42 春树&暮云 阅读(371) 评论(0) 推荐(0)
摘要: 方法 下载中文字体 ,比如SimHei.ttf 下载完的字体拷贝到matplotlib相应目录 修改 matplotlibrc文件 找到缓存目录,删除缓存,不然始终没法生效!!! 缓存目录位置查看: from matplotlib import get_cachedir print(get_cach 阅读全文
posted @ 2021-10-29 18:23 春树&暮云 阅读(54) 评论(0) 推荐(0)
摘要: This is due to one of Duckling's dependency JPype. If you dive into the code, you'll see that when starting the JVM using JPype, an argument "convertS 阅读全文
posted @ 2021-10-27 11:07 春树&暮云 阅读(244) 评论(0) 推荐(0)
摘要: 问题 vscode中terminal 显示的python版本(python2.7.x)与cmd窗口python版本(python3.7.x)不一致 解决 打开setting.json文件 搜索“terminal.integrated.env.osx” 编辑"settings.json"文件,添加: 阅读全文
posted @ 2021-10-16 22:30 春树&暮云 阅读(1617) 评论(0) 推荐(0)
摘要: 问题 用法 配合递归使用,遍历树形结构比较方便 E.g: def parse(tree): global count count += 1 for subtree in tree: label = subtree.label() if label == 'OrderBy': print(f"###: 阅读全文
posted @ 2021-10-13 20:37 春树&暮云 阅读(30) 评论(0) 推荐(0)
摘要: 问题 字典中包含非字典的子对象的序列化 方式1 使用default参数,default=lambda obj: obj.__dict__(), 保证其中包含的非字典对象的类有方法__dict__ class ID(object): def __init__(self, id) -> None: se 阅读全文
posted @ 2021-10-13 18:52 春树&暮云 阅读(147) 评论(0) 推荐(0)
摘要: 常用命令 env conda env list # 查看虚拟环境 conda create -n python2 python=2.7 anaconda ## 创建虚拟环境 常见问题 conda: command not found ~/.bashrc 添加环境变量 export PATH=$PAT 阅读全文
posted @ 2021-10-11 14:33 春树&暮云 阅读(23) 评论(0) 推荐(0)