![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 82
aoebug
这个作者很懒,什么都没留下…
展开
-
Python文件读写
你想通过Python从文件中读取文本或数据。 一.最方便的方法是一次性读取文件中的所有内容并放置到一个大字符串中: all_the_text = open('thefile.txt').read( ) # 文本文件中的所有文本 all_the_data = open('abinfile','rb').read( ) # 二进制文件中的所有数据转载 2016-08-31 10:57:26 · 319 阅读 · 0 评论 -
Python print函数用法,print 格式化输出
Python print函数用法,print 格式化输出 使用print输出各型的 字符串 整数 浮点数 出度及精度控制 strHello = 'Hello Python' print strHello #输出结果:Hello Python #直接出字符串 1.格式化输出整数 python print也支持参数格式化,与C言的printf似转载 2016-09-01 09:02:36 · 1012 阅读 · 0 评论