~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/library/mmap.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
      import mmap
100
100
 
101
101
      # write a simple example file
102
 
      with open("hello.txt", "w") as f:
 
102
      with open("hello.txt", "wb") as f:
103
103
          f.write("Hello Python!\n")
104
104
 
105
 
      with open("hello.txt", "r+") as f:
 
105
      with open("hello.txt", "r+b") as f:
106
106
          # memory-map the file, size 0 means whole file
107
107
          map = mmap.mmap(f.fileno(), 0)
108
108
          # read content via standard file methods