Modify one character in a string
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Fri May 26 18:21:58 EDT 2006
In <roy-F85321.10044225052006 at reader1.panix.com>, Roy Smith wrote:
>> Also, how do I do this when dealing with a file ; which file mode
>> should I use and what function should I use to modify a single
>> character once in that file mode?
>
> This is a much more complicated question, because it depends on the details
> of the operating system you're using. On Unix, you can seek to a specific
> place in a file, write a single character, seek to EOF, and you've done an
> in-place single character edit of the file.
Why seeking to EOF after writing the byte?
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list