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
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
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
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
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?
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