擅长:python、mysql、java
<p>只需使用Python的REPL就可以看到:</p>
<pre><code>[...]:/tmp$ cat hello.txt
hello world
[...]:/tmp$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('hello.txt', 'rb')
>>> f.seek(6, 1) # move the file pointer forward 6 bytes (i.e. to the 'w')
>>> f.read() # read the rest of the file from the current file pointer
'world\n'
</code></pre>