Re: opposite of __init__.py

2013-08-19 Thread Dave Angel
Tamer Higazi wrote: > Hi people! > > I have asked myself a question, if there is a opposite of "__init__.py" > like "__del__.py" ?! Others have answered your question, but I wanted to correct a misunderstanding: > > I want, that when the application end

Re: opposite of __init__.py

2013-08-19 Thread Steven D'Aprano
On Mon, 19 Aug 2013 18:48:19 +0200, Tamer Higazi wrote: > Hi people! > > I have asked myself a question, if there is a opposite of "__init__.py" > like "__del__.py" ?! No. If you want to run code when your application is shutting down, run it just befo

Re: opposite of __init__.py

2013-08-19 Thread Ian Kelly
Yes, see the atexit module: http://docs.python.org/3/library/atexit.html On Mon, Aug 19, 2013 at 10:48 AM, Tamer Higazi wrote: > Hi people! > > I have asked myself a question, if there is a opposite of "__init__.py" > like "__del__.py" ?! > > I want, t

opposite of __init__.py

2013-08-19 Thread Tamer Higazi
Hi people! I have asked myself a question, if there is a opposite of "__init__.py" like "__del__.py" ?! I want, that when the application ends, certain functions are executed. I know I could make a constructor and a destructor, but I simply want to know if there is a o