python怎么读取txt文件-Python读写txt文本文件

一、文件的打开和创建 1 2 3 4 5 >>> f= open('/tmp/test.txt') >>> f.read() 'hello python! hello world! ' >>> f 二、文件的读取步骤:打开 -- 读取 -- 关闭 1 2 3 4 >>> f= open('/tmp/test.txt') >>> f.read() 'hello python! hello world
相关文章
相关标签/搜索