"Marilyn Davis" <[EMAIL PROTECTED]> wrote
happy about letting the os close read only files, its really for
writing
that you want to be explicit.
Alan, will the file close, even if it was opened for writing, when
the
program ends? I know it stays open if you're interactive, but
otherwise
On Thu, June 12, 2008 4:32 pm, Alan Gauld wrote:
> "dave selby" <[EMAIL PROTECTED]> wrote
>
>
>> The whole topic came up because I just finished reading 'learning
>> python' 3rd edition OReilly as a refresher where there are multiple
>> instances of suggesting that you do the exact opposite eg ...
"dave selby" <[EMAIL PROTECTED]> wrote
The whole topic came up because I just finished reading 'learning
python' 3rd edition OReilly as a refresher where there are multiple
instances of suggesting that you do the exact opposite eg ...
LP is a tutorial book so does not always teach industry st
On Wed, 11 Jun 2008, dave selby wrote:
> The whole topic came up because I just finished reading 'learning
> python' 3rd edition OReilly as a refresher where there are multiple
> instances of suggesting that you do the exact opposite eg ...
>
> [line.rstrip() for line in open('myfile')] ... p361
Thanks for all your help guys, I am getting a strong consensus that
f.close() should be used everywhere, reading files as well as writing
files and not to rely on the PVM to do clean-up for you.
The whole topic came up because I just finished reading 'learning
python' 3rd edition OReilly as a refr
f = open(conf, 'w')
f.writelines(lines)
f.close()
Is it as safe to use the following
open(conf, 'w').writelines(lines)
ie no close() to flush the data, but also not assigned an object name
so am I right in thinking that as the object is 'reclaimed' close() is
automatically called ?
dave selby wrote:
Hi All,
Up to now I when I need to write some data to a file I have been
purposely using close()
f = open(conf, 'w')
f.writelines(lines)
f.close()
Is it as safe to use the following
open(conf, 'w').writelines(lines)
ie no close() to flush the data, but also not assigne
On Tue, Jun 10, 2008 at 10:07 AM, dave selby <[EMAIL PROTECTED]>
wrote:
> Hi All,
>
> Up to now I when I need to write some data to a file I have been
> purposely using close()
>
> f = open(conf, 'w')
> f.writelines(lines)
> f.close()
>
> Is it as safe to use the following
>
> open(conf, 'w')
On Tue, Jun 10, 2008 at 1:07 PM, dave selby <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Up to now I when I need to write some data to a file I have been
> purposely using close()
>
> f = open(conf, 'w')
> f.writelines(lines)
> f.close()
>
> Is it as safe to use the following
>
> open(conf, 'w').w
"dave selby" <[EMAIL PROTECTED]> wrote
Up to now I when I need to write some data to a file I have been
purposely using close()
f = open(conf, 'w')
f.writelines(lines)
f.close()
Is it as safe to use the following
open(conf, 'w').writelines(lines)
In theory yes, but in practice its muc
On Tue, Jun 10, 2008 at 12:07 PM, dave selby <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Up to now I when I need to write some data to a file I have been
> purposely using close()
>
> f = open(conf, 'w')
> f.writelines(lines)
> f.close()
>
> Is it as safe to use the following
>
> open(conf, 'w').
11 matches
Mail list logo