Re: [Tutor] creating files on open()

2005-05-20 Thread Alan G
> to address in binary mode - are these things possible, or do I have to > seek() to prepend and delete to clobber? Thanks. Using seek() will not prepend it will overwrite! To prepend you will have to write out your preamble then append the existing data to that. There is no random access mechan

Re: [Tutor] creating files on open()

2005-05-20 Thread Kristian Zoerhoff
On 5/20/05, William O'Higgins <[EMAIL PROTECTED]> wrote: > > Fascinating. I was opening the file read-write (r+) and it didn't work. > Are there only the few file-access methods (read (r), write (w), append > (a) and read-write (r+))? Sometimes I like to prepend or to clobber or > to address in b

Re: [Tutor] creating files on open()

2005-05-20 Thread William O'Higgins
On Fri, May 20, 2005 at 01:48:19PM -0500, Kristian Zoerhoff wrote: >On 5/20/05, William O'Higgins <[EMAIL PROTECTED]> wrote: >> When I am open()-ing a file, I sort of expect that if the file doesn't >> exist that it would be created, but it doesn't, it whines about it >> instead. So, how do I crea

Re: [Tutor] creating files on open()

2005-05-20 Thread Kent Johnson
William O'Higgins wrote: > When I am open()-ing a file, I sort of expect that if the file doesn't > exist that it would be created, but it doesn't, it whines about it > instead. So, how do I create a file with Python? I've looked all over, > but I'm obviously missing something. Thanks. Opening

[Tutor] creating files on open()

2005-05-20 Thread William O'Higgins
When I am open()-ing a file, I sort of expect that if the file doesn't exist that it would be created, but it doesn't, it whines about it instead. So, how do I create a file with Python? I've looked all over, but I'm obviously missing something. Thanks. -- yours, William signature.asc Desc