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


Groups > comp.lang.python > #11916

Re: Python import search path

References <CAAZZSFwNv1ChdY4nABYrpi3bS7tEYw5g0oODni-grp=Sae479w@mail.gmail.com>
Date 2011-08-20 13:25 +0100
Subject Re: Python import search path
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.262.1313843142.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Aug 20, 2011 at 10:52 AM, Kevin Zhang <kevin.misc.10@gmail.com> wrote:
> Found a few solution in python docs.
> A. sys.path.append

> I think A is not so pretty, and I don't have root  privilege to use B and C.
> So any both more elegant and practical solutions?

If, as I understand from your directory tree, ttt.py is a tester for
sss.py, then I'd say this is the right option. It's only going to be
used in the special environment of testing, so it's okay to have a
single line of code up the top that makes it convenient.

Chris Angelico

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


Thread

Re: Python import search path Chris Angelico <rosuav@gmail.com> - 2011-08-20 13:25 +0100

csiph-web