[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: importing two modules with the same name
From:       "Francisco Borges" <francisco.borges () gmail ! com>
Date:       2005-03-20 13:01:07
Message-ID: 1111320300.020375.129000 () g14g2000cwa ! googlegroups ! com
[Download RAW message or body]

El Pitonero wrote:
>  #--------- Main.py: your program
> import imp
> # load the third party module into sys.modules
> imp.load_source('A', '', open('C:\\A.py'))
> # load and execute your changes

Thanks a bunch for the hint. The imp module did take care of the job,
but just to mention load_source seems to be deprecated, so I used

fp, mpath, desc = imp.find_module('optparse',a)
s_opt = imp.load_module('std_optparse', fp, mpath, desc)

again, thanks for the help! 

Cheers,
Francisco

-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic