Newbie Newbie, we are all Newbie to something

Gregoire Welraeds greg at perceval.be
Fri Feb 25 14:44:26 CET 2000


Hi,

Recently I have done the following :

newLang= me.addLanguage(Python)
python_list["me"]= "greg"

try:
	newLang.readdoc()
except UnderstandingError:
	python_list["me"].sendmessage("help needed!")
 
--- Question start here ---
I'm new to Python and partially new to OOP (small experience in C++). I'm
fluent in C, shell script, awk, and some other programming language.
 
I'm currently reading the Python Reference Manual and I got a small
question regarding the __del__() statement in a class definition.
I understand his utility when you don't have a garbage collector and
memory management. In this case, it is important to have del statement to
free object properly. But what if you have ?
In the same topic, do we have to explicitly close an open file before
exiting:  
a/ a function 
	EG: 	def blahblah():
			f= open(some file)
			...
			f.close()
b/ the interpreter
 	EG:	>>> f = open(some file)
		>>> ...
		>>> f.close()
		>>> CTRL-D

Or is this automatically handled by Python. I guess the close function is
given to be used, not to generate some stupid mail like this one. 

Sorry for my newbyness ...

Greg

--
Life is not fair
But the root password helps
--

Gregoire Welraeds
greg at perceval.be
Perceval Development team
-------------------------------------------------------------------------------
Perceval Technologies sa/nv	Tel: +32-2-6409194		
Rue Tenbosch, 9			Fax: +32-2-6403154		
B-1000 Brussels			general information:   info at perceval.net
BELGIUM				technical information: helpdesk at perceval.net
URL: http://www.perceval.be/
-------------------------------------------------------------------------------






More information about the Python-list mailing list