From: cgw at fnal.gov (Charles G Waldman)
Date: Fri, 9 Apr 1999 15:12:30 GMT
Subject: import from user input?
In-Reply-To: <370E0F51.E1D33D6@appliedbiometrics.com>
References: <816010E2456BD111A48700805FBBE2EEA63EB9@ex-quebec-u1.baan.com>
	<370E0F51.E1D33D6@appliedbiometrics.com>
Message-ID: <14094.6366.328759.966352@buffalo.fnal.gov>
X-UID: 852                                                  

Christian Tismer writes:
 > 
 > import string
 > globals()[string.split(modname, ".")[0]] = __import__(modname)
 > 
 > seems to do it better.
 > 

Why not just

exec "import "+modname 

?




