Message32564
OK, let's ditch it (i.e. status quo) and also ditch execfile.
The one-liner you're looking for is *almost*
exec(open(M.__file__).read(), M.__dict__)
(where M stands for any already imported module), except for the nastiness that if m.__file__ ends with .pyc or .pyo you'd have to strip the last character. (And to do this right you'd need help from the imp module because those extensions may vary by platform -- e.g. I know of a company that patches their Pythons to use .pyc24.) |
|
Date |
User |
Action |
Args |
2007-08-23 14:58:53 | admin | link | issue1762972 messages |
2007-08-23 14:58:53 | admin | create | |
|