Re: importing two modules with the same name

2005-03-20 Thread Francisco Borges
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

Re: importing two modules with the same name

2005-03-19 Thread El Pitonero
Tim Jarman wrote: > But if your foo is under your control, why not do everyone a favour and call > it something else? His case is a canonical example of a patch. Often you'd like to choose the "patch" approach because: (1) the third-party may eventually incorporate the changes themselves, hence y

Re: importing two modules with the same name

2005-03-19 Thread El Pitonero
Francisco Borges wrote: > There are 2 "foo" named modules, 'std foo' and 'my foo'. I want to be > able to import 'my foo' and then from within my foo, import 'std > foo'. Anyone can help?? In other words, you would like to make a "patch" on third-party code. There are many ways to do it. Here is j

Re: importing two modules with the same name

2005-03-19 Thread Tim Jarman
Francisco Borges wrote: > Hello, > > This is not stricly necessary but it would be nice if I could get it > done. Here is what I want to do: > > There are 2 "foo" named modules, 'std foo' and 'my foo'. I want to be > able to import 'my foo' and then from within my foo, import 'std > foo'. Anyone

Re: importing two modules with the same name

2005-03-19 Thread Mike Meyer
Francisco Borges <[EMAIL PROTECTED]> writes: > I could simply copy optparse's code and hack it or I could simply import > it and overload some methods, which is what I think would be a cleaner > solution. So why aren't you willing to give your optparse module a different name?

importing two modules with the same name

2005-03-19 Thread Francisco Borges
Hello, This is not stricly necessary but it would be nice if I could get it done. Here is what I want to do: There are 2 "foo" named modules, 'std foo' and 'my foo'. I want to be able to import 'my foo' and then from within my foo, import 'std foo'. Anyone can help?? - Before you start