[Pyrex] Re: Globals and wrapping Eiffel

Andreas Kostyrka andreas at mtg.co.at
Wed Nov 19 16:43:10 CET 2003


On Wed, Nov 19, 2003 at 03:31:18PM +0100, Godefroid Chapelle wrote:
> This was the question I wanted to ask : is there a way in Pyrex to
> declare some code that must run once when the extension module is imported ?
Does this answer your question:
Python 2.3 (#2, Sep  8 2003, 13:25:25)
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import t
hello
>>> import t
>>> import t
>>> import t
>>> del t
>>> import t
>>> print open("t.pyx").read()
print "hello"

Andreas




More information about the Pyrex mailing list