Re: importar modulos

Juan José Gómez Romera <[email protected]>
Newsgroups gmane.comp.python.general.castellano
Message-ID <[email protected]>
El 16 de septiembre de 2009 17:25, Marcos Garcia <[email protected]>escribió:

> Tienes que añadir un archivo llamado __init__.Py en cada directorio.
>
>
llevo rato intentándolo y siempre me da el mismo error, ponga el archivo
__init__.py o no, siempre me da este error:

jjgomera@ordenata:~/Programacion/pychemqt/ciclones$ ./ciclonwindow.py
Traceback (most recent call last):
  File "./ciclonwindow.py", line 11, in <module>
    from ..unidades import temperatura
ValueError: Attempted relative import in non-package

Uso python 2.5, por eso también he añadido al principio del archivo la
linea:

from __future__ import absolute_import

pero nada

La verdad es que de la otra manera funciona, pero esta forma me parece más
intuitiva para aclararme de donde se importa cada modulo
_______________________________________________
Lista de correo Python-es 
http://listas.aditel.org/listinfo/python-es
FAQ: http://listas.aditel.org/faqpyes
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.