摘要: 需求 ubuntu系统以非root开机自动挂载外接磁盘 步骤 查看外接磁盘UUID 方式1: 使用Ubuntu系统自带的磁盘工具 "磁盘" 查看磁盘UUID 方式2: sudo fdisk -l 编辑/etc/fstab sudo vim /etc/fstab UUID=02901fxxxxxx / 阅读全文
posted @ 2021-11-29 14:42 春树&暮云 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 方法 下载中文字体 ,比如SimHei.ttf 下载完的字体拷贝到matplotlib相应目录 修改 matplotlibrc文件 找到缓存目录,删除缓存,不然始终没法生效!!! 缓存目录位置查看: from matplotlib import get_cachedir print(get_cach 阅读全文
posted @ 2021-10-29 18:23 春树&暮云 阅读(28) 评论(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 春树&暮云 阅读(161) 评论(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 春树&暮云 阅读(1050) 评论(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 春树&暮云 阅读(20) 评论(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 春树&暮云 阅读(123) 评论(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 春树&暮云 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 问题 服务器端开启jupter-notebook,并且只允许localhost方式启动,本机如何访问远程服务器的jupter? 方法 Using SSH Tunneling Using Reverse Proxy 详情参考 访问远程jupter-notebook 阅读全文
posted @ 2021-09-30 14:58 春树&暮云 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 问题 from .duckling import Duckling >>> ImportError: numpy.core.multiarray failed to import 解决方法 numpy版本和duckling不兼容,需要版本匹配,卸载numpy,重新安装numpy 解决 以下版本验证兼 阅读全文
posted @ 2021-09-30 13:56 春树&暮云 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 问题 针对一个字符串按特定模式,比如数字、字母、表情符等分割 方法 使用python的re库 import re re_han = re.compile("([\u4E00-\u9FD5a-zA-Z0-9+#&\._%\-]+)", re.U) re_eng = re.compile('[a-zA- 阅读全文
posted @ 2021-09-30 10:34 春树&暮云 阅读(384) 评论(0) 推荐(0) 编辑