Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'importing': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:design': 0.09; 'python': 0.11; 'jan': 0.12; 'exist.': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Language': 0.16; 'wrote:': 0.18; 'module': 0.19; 'import': 0.22; 'header:User-Agent:1': 0.23; 'source': 0.25; 'equivalent': 0.26; 'task': 0.26; 'skip:" 20': 0.27; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'code': 0.31; 'file': 0.32; 'languages': 0.32; 'but': 0.35; 'skip:o 20': 0.38; 'ben': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'skip:_ 30': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:173': 0.61; 'address': 0.63; 'received:fios.verizon.net': 0.84; 'have.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Language design Date: Wed, 11 Sep 2013 19:51:58 -0400 References: <522eb795$0$29999$c3e8da3$5496439d@news.astraweb.com> <7wbo412m02.fsf@benfinney.id.au> <7wy5730wv5.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: <7wy5730wv5.fsf@benfinney.id.au> 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378943533 news.xs4all.nl 15933 [2001:888:2000:d::a6]:54913 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54011 On 9/11/2013 7:19 PM, Ben Finney wrote: > Er? That doesn't address the task of importing a module from a source > code file given its path on the filesystem. > > Other languages have the equivalent of =E2=80=98include "/path/to/file.= py"=E2=80=99, Some includes are equivalent to with open("/path/to/file.py") as f: exec(f.read()) > but Python doesn't. which Python does have. Python also has __import__("/path/to/file.py"), which is used by import=20 when the module does not exist. --=20 Terry Jan Reedy