随笔分类 -  python

摘要:import io import os from PyPDF2 import PdfReader, PdfWriter from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4 from reportlab. 阅读全文
posted @ 2024-12-16 08:46 卓能文 阅读(45) 评论(0) 推荐(0) 编辑
摘要:nuitka # test.py def add(x: int, y: int) -> int: return x + y print(add(2, 3)) nuitka test.py --onefile --clang --static-libpython=yes # justfile buil 阅读全文
posted @ 2024-10-27 10:57 卓能文 阅读(46) 评论(0) 推荐(0) 编辑
摘要:# 安装 ```bash pip install black ``` 为了格式化Jupyter Notebooks ```bash pip install "black[jupyter]" ``` 使用: ```bash black *.py ``` 阅读全文
posted @ 2023-05-29 20:13 卓能文 阅读(52) 评论(0) 推荐(0) 编辑
摘要:# 安装 目前只linux和mac系统。从下载最新版进行安装。然后设置环境变量: ```bash export PATH=~/.codon/bin:$PATH export CODON_PYTHON=/usr/lib/libpython3.10.so ``` 上述路径换成自己的系统路径。下面的示例代 阅读全文
posted @ 2023-05-29 19:42 卓能文 阅读(279) 评论(0) 推荐(0) 编辑
摘要:哥德巴赫猜想(Goldbach's conjecture)是数论中存在最久的未解问题之一。这个猜想最早出现在1742年普鲁士数学家克里斯蒂安·哥德巴赫与瑞士数学家莱昂哈德·欧拉的通信中。用现代的数学语言,哥德巴赫猜想可以陈述为: “ 任一大于2的偶数,都可表示成两个素数之和。 ” 这个猜想与当时欧洲 阅读全文
posted @ 2023-05-27 10:59 卓能文 阅读(538) 评论(0) 推荐(0) 编辑
摘要:一种方法是用`rcParams`修改字体族,这样代码只需要修改一处。示例代码如下: ```python import numpy as np import matplotlib.pyplot as plt # Set chinese font family # 在linux上可用: # $ fc-l 阅读全文
posted @ 2023-05-27 10:16 卓能文 阅读(146) 评论(0) 推荐(0) 编辑
摘要:更新pip包 Windows pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_} linux pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = 阅读全文
posted @ 2021-12-03 14:31 卓能文 阅读(48) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示