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


Groups > comp.lang.python > #49619

Re: PYTHONPATH and module names

References <mailman.4074.1372703671.3114.python-list@python.org> <fa971601-b90f-4d1a-81d2-67b0c76e30d1@googlegroups.com> <G7lAt.13847$J_1.8584@newsfe01.iad>
Date 2013-07-01 16:40 -0400
Subject Re: PYTHONPATH and module names
From "SpaghettiToastBook ." <spaghettitoastbook@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4106.1372749627.3114.python-list@python.org> (permalink)

Show all headers | View raw


Relative imports only work with the "from ... import ..." form.

— SpaghettiToastBook


On Mon, Jul 1, 2013 at 3:54 PM, 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 "license" for more information.
>>>> from __future__ import absolute_import
>>>> import .format
>   File "<stdin>", line 1
>     import .format
>            ^
> SyntaxError: invalid syntax
>>>>
>
> --
> http://mail.python.org/mailman/listinfo/python-list

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


Thread

PYTHONPATH and module names Tobiah <tshepard@rcsreg.com> - 2013-07-01 11:29 -0700
  Re: PYTHONPATH and module names rusi <rustompmody@gmail.com> - 2013-07-01 11:39 -0700
    Re: PYTHONPATH and module names Tobiah <toby@tobiah.org> - 2013-07-01 12:54 -0700
      Re: PYTHONPATH and module names rusi <rustompmody@gmail.com> - 2013-07-01 14:38 -0700
        Re: PYTHONPATH and module names Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-01 22:05 +0000
          Re: PYTHONPATH and module names Lele Gaifax <lele@metapensiero.it> - 2013-07-02 07:30 +0200
      Re: PYTHONPATH and module names Fábio Santos <fabiosantosart@gmail.com> - 2013-07-01 23:08 +0100
      Re: PYTHONPATH and module names "SpaghettiToastBook ." <spaghettitoastbook@gmail.com> - 2013-07-01 16:40 -0400

csiph-web