How does f=open('mytext.txt', 'w+') work?

Fredrik Lundh fredrik at pythonware.com
Sun Sep 18 12:56:13 EDT 2005


"Alex" wrote:

> If I open the file mytext.txt in Notepad I see something that begins
> with
>
> "My name is Bob  VwMÚ¸x¶ Ð"
>
> and goes on for approximately 4082 characters.
>
> What's happening??

you're moving the file pointer around in a new file, and you're getting
junk (from the stdio file buffers, most likely) in the places where you
haven't written anything yourself.

</F> 






More information about the Python-list mailing list