Import question

Stephen Hansen news at myNOSPAM.org
Sun May 20 01:15:45 EDT 2001


    Not easil, but you can.look at the 'imp' module in the standard library.
Really, I'd just deal with the annoyance. :) Generally, I don't have any
need to add anything tothe sys.path. Any modules my programs have to load
are either in the directory of my main program file, or in a sub-directory
which I set up as a package, and that lets everything behave nicely without
sys.path bloat,.. or any unfriendly hacks.

--Stephen

--
(replace 'NOSPAM' with 'seraph' to respond in email)


"Costas Menico" <costas at meezon.com> wrote in message
news:3b06c980.4101997 at News.CIS.DFN.DE...
> I find it annoying to force my code to be imported only from sys.path.
> Is there a way to import code from any path without having to add it
> to sys.path?
>
> e.g. Why can't we do import c:\\myapppath\\myutil and then that would
> make myutil be loaded.
>
> costas





More information about the Python-list mailing list