[Tutor] Passing a variable to 'import'

dman dsh8290@rit.edu
Fri, 21 Dec 2001 12:56:55 -0500


On Wed, Dec 19, 2001 at 11:17:30PM -0500, Chris Keelan wrote:

| So how do I, for example, grab a module name from sys.argv and then pass it 
| to the import command as a variable?

the_mod = __import__( sys.argv[1] )

-D

-- 

If we claim we have not sinned, we make Him out to be a liar and His
Word has no place in our lives.
        I John 1:10