Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.06; 'subject:search': 0.07; 'python': 0.08; 'okay': 0.09; 'am,': 0.12; 'docs.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:import': 0.16; 'wrote:': 0.16; 'header :In-Reply-To:1': 0.22; 'testing,': 0.23; 'aug': 0.24; 'code': 0.25; 'kevin': 0.28; 'sat,': 0.28; 'message-id:@mail.gmail.com': 0.29; 'environment': 0.29; 'if,': 0.30; 'chris': 0.32; 'to:addr :python-list': 0.33; 'elegant': 0.34; 'option.': 0.34; 'root': 0.34; 'think': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'skip:\xa0 10': 0.39; 'to:addr:python.org': 0.39; "i'd": 0.40; "it's": 0.40; 'more': 0.60; 'your': 0.61; 'special': 0.67; '10:52': 0.84; 'zhang': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=7rrHiGtfOa6uCLzJ56+0xIVPACc9IgN3NhbQSMdaWFk=; b=Cbq8gPQFT9/ntMB8Q65xTAoziBrtJf7w9L48Iaj5fvRPCXhtj7aNgJcRVyPXdwXHXm XBWST2fczMd6SOHKsVzyNoBTBnVeqLtuVZybzDZMnVYQMy1W+d7jogXDfNf/glq/iE26 hNIGNMJ3MqxH8mlMdBR7IZl4t+cMW7C44/PlE= MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 20 Aug 2011 13:25:39 +0100 Subject: Re: Python import search path From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313843142 news.xs4all.nl 23866 [2001:888:2000:d::a6]:51237 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11916 On Sat, Aug 20, 2011 at 10:52 AM, Kevin Zhang wro= te: > Found a few solution in python docs. > A. sys.path.append > I think A is not so pretty, and I don't have root =A0privilege=A0to 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