Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15874

Re: How to insert my own module in front of site eggs?

From Paul Rudin <paul.nospam@rudin.co.uk>
Newsgroups comp.lang.python
Subject Re: How to insert my own module in front of site eggs?
Date 2011-11-18 05:54 +0000
Message-ID <87wraydlh4.fsf@no-fixed-abode.cable.virginmedia.net> (permalink)
References <roy-EB07D8.20574216112011@news.panix.com> <1s1fp8-6la.ln1@pluto.solar-empire.de> <roy-DD0C8A.09093317112011@news.panix.com> <874ny2fzn6.fsf@no-fixed-abode.cable.virginmedia.net> <roy-C6E9FF.20363817112011@news.panix.com>

Show all headers | View raw


Roy Smith <roy@panix.com> writes:

> In article <874ny2fzn6.fsf@no-fixed-abode.cable.virginmedia.net>,
>  Paul Rudin <paul.nospam@rudin.co.uk> wrote:
>
>> 
>> Maybe I'm missing something - but if I want to do this I just mess about
>> with sys.path at the top of my python script/program. Always seems to
>> work... is there a situation in which it doesn't?
>
> What if the first import of a module is happening inside some code you 
> don't have access to?

If you change sys.path first - before you do any imports - then any
other imports will surely come from the first thing on sys.path (unless
something else you import also changes sys.path)?


Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to insert my own module in front of site eggs? Roy Smith <roy@panix.com> - 2011-11-16 20:57 -0500
  Re: How to insert my own module in front of site eggs? Marc Christiansen <usenet@solar-empire.de> - 2011-11-17 10:48 +0100
    Re: How to insert my own module in front of site eggs? Roy Smith <roy@panix.com> - 2011-11-17 09:09 -0500
      Re: How to insert my own module in front of site eggs? Duncan Booth <duncan.booth@invalid.invalid> - 2011-11-17 15:04 +0000
        Re: How to insert my own module in front of site eggs? Roy Smith <roy@panix.com> - 2011-11-17 20:38 -0500
      Re: How to insert my own module in front of site eggs? Paul Rudin <paul.nospam@rudin.co.uk> - 2011-11-17 17:05 +0000
        Re: How to insert my own module in front of site eggs? Roy Smith <roy@panix.com> - 2011-11-17 20:36 -0500
          Re: How to insert my own module in front of site eggs? alex23 <wuwei23@gmail.com> - 2011-11-17 18:58 -0800
            Re: How to insert my own module in front of site eggs? Hans Mulder <hansmu@xs4all.nl> - 2011-11-18 11:52 +0100
          Re: How to insert my own module in front of site eggs? Paul Rudin <paul.nospam@rudin.co.uk> - 2011-11-18 05:54 +0000
          Re: How to insert my own module in front of site eggs? "spartan.the" <spartan.the@gmail.com> - 2011-11-20 12:44 -0800

csiph-web