which one of these is better?

John Salerno johnjsal at NOSPAMgmail.com
Thu Oct 26 15:15:04 EDT 2006


Michael B. Trausch wrote:

> Not really über-qualified to say anything, but I think that the
> following would be better:
> 
> try:
> 	f = open('file.sql')
> 	script = f.read()
> 	f.close()
> except IOError:
> 	wx.MessageBox('Message', 'Message Title')

I was thinking of something like this actually.

> Not sure about the with-- I just went to read the PEP on it, and it
> confused me greatly.  :-)  So, I don't know.

Ditto. :)



More information about the Python-list mailing list