Bug writing/reading to file.

Arne arne.k.h at gmail.com
Mon Dec 24 07:31:41 EST 2007


On Dec 24, 12:53 pm, arne.... at gmail.com wrote:
> Hi! :)
>
> Im new to python, and I have made a electronic diary - its just a
> task. Here is the code:http://pastebin.com/m49391798
>
> The bug is (feel free to download and test it) that i can't see what i
> wrote in the diary without restarting the program. Here is an example:
>
> 1: I start the program
> 2: (text.txt is empty)
> 3: I write "hello, how are you?" with the writing-function in the
> program
> 4; I use the read-all-function in the program.
> 5: There is no entries in the diary. But if I restart the program, I
> can read the file.
>
> The strange thing is that if i watch the file contents while im using
> the program, I see that i add the line "hello, how are you?" to the
> file, but i can't read it with the read-function.
>
> Can this be a problem with file-pointers? And how can i solve it?

The problem is solved! Thanks for the help!



More information about the Python-list mailing list