import sys.argv[1]

ssh heinlr at gmx.de
Mon Jun 11 11:16:30 CEST 2001


look source code:
       # so something
       str = "import  mySuperModul"
       exec( str ) # executes a complete individual command

or

mod = __import__("mySuperModul")

func  = getattr(mod, "myFunc_in_SuperModul") #

func( 1, 2 ,3 ....)

i hope it helps




"Ben" <b.e.n. at .r.e.h.a.m.e...c.o.m> schrieb im Newsbeitrag
news:gor8itchcafd4t82fnheo0s4g9frfipdhv at 4ax.com...
> Hi all,
>
> this must have been a situation that lots of people have  come across
> so there has to be a work around for it. If I define via a command
> line arg what module(s) needs to be imported how do i then pass this
> to the import statement without the import statement taking
>
> sys.argv[1]
>
> literally?
>
> Thanks
>
> Ben
>





More information about the Python-list mailing list