Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'escape': 0.09; 'windows,': 0.09; 'cc:addr:python-list': 0.11; 'windows': 0.15; 'backslashes': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'igor': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'cc:addr:python.org': 0.22; 'skip:% 10': 0.24; 'versions': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'this:': 0.26; 'header:In- Reply-To:1': 0.27; 'correct': 0.29; 'message-id:@mail.gmail.com': 0.30; 'fri,': 0.33; 'something': 0.35; 'received:google.com': 0.35; 'hi,': 0.36; 'skip:o 20': 0.38; 'system,': 0.38; 'others.': 0.38; 'pm,': 0.38; "you'll": 0.62; 'forward': 0.65; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=xE/uJsBpLOfh+SFidQluDu9HZaJok9VbEGMV76xyLy0=; b=iOmu4nN4ZR4fmBeEkP7ll81zpwjl9HAGqARsfsJmgJspSNJjBOLpm8D/hHzjElvUvV i2IYOXp83NxKCzCGz3twhIwZI/vQTpVK+rD8NIUA2hkG5D9N96OxLWyAEWGYbPGGgzt7 ZZFneKWpcyIHJWetRi8nEwuzM8I/I/cThorFoXR7k4QWOuh5y10vG3iQnZh/ML/2I2eR 6zq9/NaBIcPINjEE0C17BWa3FbPaO3J2H99XzACqS5Cw62frad78VGyN46imPD2QF8IT r/CBi66yWc014njUysdG3CYrC+uzQi4lk7efFtgm/nFFTh0jYPYMKMrlmRPQfIPT80jJ foCA== MIME-Version: 1.0 X-Received: by 10.50.20.169 with SMTP id o9mr3960147ige.14.1412924287849; Thu, 09 Oct 2014 23:58:07 -0700 (PDT) In-Reply-To: <54377d29$0$2833$e4fe514c@news.xs4all.nl> References: <54377d29$0$2833$e4fe514c@news.xs4all.nl> Date: Fri, 10 Oct 2014 17:58:07 +1100 Subject: Re: python on Linux From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412924297 news.xs4all.nl 2893 [2001:888:2000:d::a6]:49002 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3763 X-Received-Body-CRC: 1020149788 Xref: csiph.com comp.lang.python:78928 On Fri, Oct 10, 2014 at 5:31 PM, Irmen de Jong wrote: > On 10-10-2014 6:21, Igor Korot wrote: >> Hi, ALL, >> When I am on Windows, I can write something like this: >> >> sys.path.append('C:\Users\Igor\Documents\MyLib') > > While this might work on your system, it may not work on others. > > - you need to escape the backslashes (or just use forward slashes, they work on windows too) > - not all windows installations and versions have their user folders in > C:\Users\. On windows too, you'll have to use something like %USERPROFILE% to > get to the correct directory if you want it to work correctly in all cases. AIUI you can use os.path.expanduser() on Windows as well, and it'll take care of USERPROFILE. ChrisA