PYTHONPATH and module names

Fábio Santos fabiosantosart at gmail.com
Tue Jul 2 00:08:48 CEST 2013


On 1 Jul 2013 20:58, "Tobiah" <toby at 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
> >>>

Have you tried

from . import format

?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130701/248cb9d1/attachment.html>


More information about the Python-list mailing list