closing file

M

Marcello Pietrobon

Hello,

Once I open a file, for example as:
class MyClass:
def logFileOpen( self ):
self.fdFilenameLog = file( self.filenameLog, 'a' )
return

I cannot find in hte documentation how to make sure the file are closed.

I guess that Python is closing all files at the end of the application
or when an Exception is raised

Is this true ?
Is the file closed when the destructor is called ? ( Internally because
I don't see a way to call a destructor in Python ).

Thank you very much,
Marcello
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,186
Messages
2,570,997
Members
47,586
Latest member
Gilda57E93

Latest Threads

Top