
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 · 355 阅读 · 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 · 1128 阅读 · 0 评论