Converting a Shell Script to run under Python

Mikael Olofsson mikael at isy.liu.se
Wed Dec 8 02:53:23 EST 1999


On 07-Dec-99 D'Arcy J.M. Cain wrote:
 >  Magnus L. Hetland <mlh at vier.idi.ntnu.no> wrote:
 >  
 > > open("file3","w").write(open("file1").read())
 >  
 > > though that is probably not a good idea. I guess I would rather do
 >  
 >  Why don't you find this a good idea?  It's pretty much a Python paradigm
 >  as far as I'm concerned.  

I've always thought that I should close my files when I'm done. I can't 
see how that should/could be done using this paradigm. What if I want to
reaccess any of the files? Doesn't that cause problems? Or will the files 
be automagically closed since I haven't bound them to any variable?

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    08-Dec-99
Time:    08:45:36

This message was sent by XF-Mail.
-----------------------------------------------------------------------



More information about the Python-list mailing list