![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
水月清辉
既然活着就不能荒废一生一次的机会,所以得好好的活着。
展开
-
python之求解立方根
python求立方根原创 2022-06-18 00:22:19 · 5104 阅读 · 0 评论 -
python之求最小公倍数
利用python求最小公倍数原创 2022-06-18 00:01:03 · 5617 阅读 · 0 评论 -
python之24点牌游戏
python实现24点牌游戏原创 2022-06-17 00:32:53 · 777 阅读 · 0 评论 -
python之走方格算法
走方格算法原创 2022-06-15 23:29:11 · 695 阅读 · 0 评论 -
python之字符串处理
python处理字符串常用方法原创 2022-06-15 23:21:38 · 1779 阅读 · 0 评论 -
python之常用快捷键
python常用的快捷键原创 2022-06-15 23:20:58 · 16479 阅读 · 0 评论 -
python之表格处理
python之表格处理原创 2022-06-15 23:19:56 · 1926 阅读 · 0 评论 -
python之pip使用
python中pip安装模块原创 2022-06-15 23:19:06 · 524 阅读 · 1 评论 -
python之mysql
python处理mysql原创 2022-06-15 23:18:03 · 221 阅读 · 0 评论 -
python之组合排序
itertool组合排序原创 2022-06-15 23:15:57 · 246 阅读 · 0 评论 -
python之发送邮件
python发送邮件原创 2022-06-09 00:05:53 · 1345 阅读 · 0 评论 -
python文件读read()、readline()、readlines()对比
一、read方法: read()直接读取字节到字符串中,包括了换行符 特点是:读取整个文件,将文件内容放到一个字符串变量中。 劣势是:如果文件非常大,尤其是大于内存时,无法使用read()方法。file = open('test.txt', 'r') # 创建的这个文件,也是一个可迭代对象text = file.read() # 默认将所有文件读出print(text)file.close() 二、readline方法 读取整行,包括行结束符,并作为字符串返回...原创 2021-05-15 09:49:30 · 864 阅读 · 0 评论 -
python文件操作
1,打开文件列表: 模式 描述 t 文本模式 (默认)。 x 写模式,新建一个文件,如果该文件已存在则会报错。 b 二进制模式。 + 打开一个文件进行更新(可读可写)。 U 通用换行模式(不推荐)。 r 以只读方式打开文件。文件原创 2021-05-15 09:29:36 · 86 阅读 · 0 评论 -
Python requests 爬虫实战1
# -*- coding: UTF-8 -*-import requestsimport reimport randomimport stringdef write_file(file, content): with open(file, "wb") as f: f.write(content) print "done"def down_picture(file, url, headers): response = requests.get(.原创 2021-05-15 09:10:49 · 68 阅读 · 0 评论 -
Python文件处理
文件打开方式:‘r’ 以只读的方式打开文件,文件的描述符放在文件的开头。‘rb’ 以二进制格式打开一个文件用于只读,文件的描述符放在文件的开头。‘r+’ 打开一个文件用于读写,文件的描述符放在文件的开头。‘w’ 打开一个文件只用于写入,若该文件已经存在则覆盖,若不存在则创建一个新的文件。‘wb’ 打开一个文件只用于写入二进制,若该文件已存在则覆盖,若不存在则创建新文件。‘w+’ 打开一...原创 2018-11-02 08:40:38 · 81 阅读 · 0 评论