python3
七娃Ooo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
服务器更新python3.9后使用pip的一些问题总结
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.9/distutils/__init__.py) 首先搜索一下 软件源里有没有 3.9的distutils :apt search distutils 然后安装 一下 apt install python3.9-distutils AttributeError: 'HTMLParser' object has no attrib...原创 2020-11-17 20:38:56 · 3686 阅读 · 0 评论 -
python3 使用records 时没有MySQLdb
使用records时提示 ModuleNotFoundError: No module named 'MySQLdb' 原因是缺少 mysqlclient pip3 install mysqlclient 提示缺少 mysql_config 在命令行里直接执行 mysql_config会提示 程序“mysql_config”尚未安装。 您可以使用以下命令安装: apt install...原创 2019-10-31 15:17:48 · 469 阅读 · 0 评论 -
strip 双乘号 set,以及用法
str = " abcdefg " str.strip() #用于去掉字符串两边的空格 2**2 #output 4 3**2 #output 9 由这两式可知,两个*是算次方 [x*10 for i in range(1,5)] #output 10,20,30,40,50 [[x,x*10] for i in range(1,5)] #output [1,10],[2,20],[3,30],[4,40],[5,50] >>> a = set('abracadabra') >原创 2010-12-24 15:23:00 · 794 阅读 · 0 评论 -
python3 文件和文件夹操作
<br />#文件创建 with open('filename.txt','w') as f: f.write('123456') #删除文件 import os os.remove('filename.txt') #创建文件夹 os.mkdir('dirname') #删除文件夹 os.rmdir('dirname') #拷贝文件 import shutil shutil.copy(oldfilename, newfilename) #移动文件 shutil.move(原创 2011-05-28 16:06:00 · 2206 阅读 · 0 评论 -
python3 urllib.request
<br />#python 打开网络文件 import urllib.request with urllib.request.urlopen('http://www.baidu.com') as f: content = f.read().decode('gb2312') print(content) #使用with后不必再关闭资源,同样open()的文件操作也可以使用原创 2011-05-28 16:01:00 · 1628 阅读 · 0 评论 -
You Get 需要用到的记录
extractor.py 202原创 2017-01-23 20:59:04 · 616 阅读 · 0 评论 -
pm2 开始python任务
pm2 start myscript.py -x --interpreter python翻译 2018-05-03 12:38:08 · 3901 阅读 · 1 评论 -
ubuntu安装python3.7时 No module named ‘_ctypes‘ 和 无法使用ssl
No module named '_ctypes' apt install libffi-dev 无法使用ssl 原因是openssl的模块版本太低,解决方法是安装libssl apt install libssl-dev原创 2019-04-05 09:39:54 · 9844 阅读 · 1 评论
分享