Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'subject:module': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '>>': 0.16; '(ubuntu': 0.16; '2.7.3': 0.16; '__future__': 0.16; 'syntaxerror:': 0.16; 'url:whatsnew': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; '>>>': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; "doesn't": 0.30; 'absolute': 0.30; 'relative': 0.30; 'message-id:@mail.gmail.com': 0.30; '"",': 0.31; 'work:': 0.31; 'file': 0.32; 'url:python': 0.33; 'received:google.com': 0.35; 'url:org': 0.36; 'skip:4 10': 0.37; 'skip:& 10': 0.38; 'skip:& 20': 0.39; 'url:5': 0.61; 'more': 0.64; 'invalid': 0.68; 'jul': 0.74; '2013': 0.98 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:to :cc:content-type; bh=osSzmh7o1kT6Aiow4WlLL78q0l9PGa+UpJfasq5KJ0s=; b=c6KXhVakwtjWHz/vSdIQj2fRA2MnfeUGUzaaCGeYTqKuUPatsYv4QmUXKexSHhcc2B dd02pOrkT6ZUvNSp7QInIsNYomKpsXerg+rR2v9VELBH0Z/KdaIB6g60+e4lYMZjVka/ FJxx/ueOelQzmjVscgglW8J6PsBSnl3taKxRMrLYZAJgS6tpzRunVvGEsZA1FECt9SkH grjmd5s9ykeqWmpVQX9Co4YcfPaVLntAtl8ONV18UVBhY0uQSxiUrJtOZApRVef2Z/Oi NUbyzlNcwqgVwGT3i8pdblOSmGnMeZ1lvstNMmZbUbfFQ4BQWr89GxCM9sA8Sms5z4ZP HO7w== MIME-Version: 1.0 X-Received: by 10.49.60.7 with SMTP id d7mr33884267qer.82.1372716529294; Mon, 01 Jul 2013 15:08:49 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Jul 2013 23:08:48 +0100 Subject: Re: PYTHONPATH and module names From: =?ISO-8859-1?Q?F=E1bio_Santos?= To: Tobiah Content-Type: multipart/alternative; boundary=047d7b67625e1b258704e07a79e9 Cc: python-list@python.org 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: 59 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372717015 news.xs4all.nl 15946 [2001:888:2000:d::a6]:55513 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49598 --047d7b67625e1b258704e07a79e9 Content-Type: text/plain; charset=ISO-8859-1 On 1 Jul 2013 20:58, "Tobiah" wrote: >> >> Are you familiar with absolute and relative imports: >> http://docs.python.org/release/2.5/whatsnew/pep-328.html > > > Doesn't seem to work: > > Python 2.7.3 (default, May 10 2012, 13:31:18) > [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from __future__ import absolute_import > >>> import .format > File "", line 1 > import .format > ^ > SyntaxError: invalid syntax > >>> Have you tried from . import format ? --047d7b67625e1b258704e07a79e9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On 1 Jul 2013 20:58, "Tobiah" <toby@tobiah.org> wrote:
>>
>> Are you familiar with absolute and relative imports:
>> http://docs.python.org/release/2.5/whatsnew/pep-328.html
>
>
> Doesn't seem to work:
>
> Python 2.7.3 (default, May 10 2012, 13:31:18)
> [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2
> Type "help", "copyright", "credits" or &= quot;license" for more information.
> >>> from __future__ import absolute_import
> >>> import .format
> =A0 File "<stdin>", line 1
> =A0 =A0 import .format
> =A0 =A0 =A0 =A0 =A0 =A0^
> SyntaxError: invalid syntax
> >>>

Have you tried

from . import format

?

--047d7b67625e1b258704e07a79e9--