Python读写txt文本文件

  Python读写txt文本文件 一、文件的打开和创建 1 2 3 4 5 >>> f = open('/tmp/test.txt') >>> f.read() 'hello python!\nhello world!\n' >>> f <open file '/tmp/test.txt', mode 'r' at 0x7fb2255efc00>   二、文件的读取 步骤:打开 -- 读取 --
相关文章
相关标签/搜索