double import protection - how to ?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Nov 29 07:54:10 EST 2008


On Sat, 29 Nov 2008 13:43:45 +0100, Helmut Jarausch wrote:

> How can I achieve that  all/some statements within that module get
> executed only at the very first import? (the statement which must be
> executed only once, initializes another OS-thread (java in my case))

Python already enforces that. import only executes the module once, the 
first time.


-- 
Steven



More information about the Python-list mailing list