python
scy123
这个作者很懒,什么都没留下…
展开
-
python 安装配置内容
python出现"No module named "XXX""的解决办法 1.已安装pip 先定位到pip安装目录,可以通过where pip 指令查询 1)查询安装目录 2)定位 2.下载安装第三方库 ...转载 2020-02-06 13:58:25 · 106 阅读 · 0 评论 -
python基础知识集锦
#查看数据类型 data="123" print(type(data) ) # 输出 :<class 'str'> #中文转bytes print("中".encode('unicode_escape'))# unicode编码输出: b'\\u4e2d'原创 2020-01-02 20:46:42 · 88 阅读 · 0 评论 -
python--文件操作删除某行
第一种:是先把文件读入内存,在内存中修改后再写入源文件。 例子:将内容包含“123”的所有行删去: with open('C:/Users/lai/Desktop/1.txt','r') as r: lines=r.readlines() with open('C:/Users/lai/Desktop/1.txt','w') as w: for l in lines: ...转载 2019-12-20 11:09:20 · 1322 阅读 · 0 评论