File tree 4 files changed +3
-3
lines changed
4 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ if __name__ == '__main__':
103
103
main()
104
104
```
105
105
106
- 要将文本信息写入文件文件也非常简单,在使用` open ` 函数时指定好文件名并将文件模式设置为` 'w' ` 即可。注意如果需要对文件内容进行追加式写入,应该将模式设置为` 'a' ` 。如果要写入的文件不存在会自动创建文件而不是引发异常。下面的例子演示了如何将1-9999直接的素数分别写入三个文件中 (1-99之间的素数保存在a.txt中,100-999之间的素数保存在b.txt中,1000-9999之间的素数保存在c.txt中)。
106
+ 要将文本信息写入文件文件也非常简单,在使用` open ` 函数时指定好文件名并将文件模式设置为` 'w' ` 即可。注意如果需要对文件内容进行追加式写入,应该将模式设置为` 'a' ` 。如果要写入的文件不存在会自动创建文件而不是引发异常。下面的例子演示了如何将1-9999之间的素数分别写入三个文件中 (1-99之间的素数保存在a.txt中,100-999之间的素数保存在b.txt中,1000-9999之间的素数保存在c.txt中)。
107
107
108
108
``` Python
109
109
from math import sqrt
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ Pillow中最为重要的是Image类,读取和处理图像都要通过这个类
76
76
77
77
``` Python
78
78
>> > image = Image.open(' ./res/guido.png' )
79
- >> > image.rotata (180 ).show()
79
+ >> > image.rotate (180 ).show()
80
80
>> > image.transpose(Image.FLIP_LEFT_RIGHT ).show()
81
81
```
82
82
Original file line number Diff line number Diff line change @@ -489,7 +489,7 @@ connecting to: mongodb://172.18.61.250:27017/
489
489
490
490
使用MongoDB可以非常方便的配置数据复制,通过冗余数据来实现数据的高可用以及灾难恢复,也可以通过数据分片来应对数据量迅速增长的需求。关于MongoDB更多的操作可以查阅[ 官方文档] ( https://mongodb-documentation.readthedocs.io/en/latest/ ) ,同时推荐大家阅读Kristina Chodorow写的[ 《MongoDB权威指南》] ( http://www.ituring.com.cn/book/1172 ) 。
491
491
492
- ####在Python程序中操作MongoDB
492
+ #### 在Python程序中操作MongoDB
493
493
494
494
可以通过pip安装pymongo来实现对MongoDB的操作。
495
495
You can’t perform that action at this time.
0 commit comments