Importing problems

Premshree Pillai premshree_python at yahoo.co.in
Thu Nov 11 21:37:43 CET 2004


I'm not sure it's an import problem. Had that been the
case you'd've got an ImportError exception.

 --- Gabriele *darkbard* Farina <darkbard at gmail.com>
wrote: 
> Hi
> 
> I've my application filesystem structured like this:
> 
> app/
> -main.py
> -pharaon/
> --__init__.py
> --engine/
> ---__init__.py
> ---php/
> ----__init__.py
> ----tokenizer.py
> --utils
> ---__init__.py
> ---buffers.py
> 
> 
> I'd like to use a class defined in the module
> pharaon/utils/buffers.py
> inside a class defined in
> pharaon/engine/php/tokenizer.py
> 
> I import the class this way (inside buffers.py):
> from pharaon.utils.buffers import FileBuffer
> 
> and then I use the class this way:
> class Tokenizer:
> def __init__(self, source):
> self.buffer = FileBuffer(source)
> 
> inside the main.py file I got this code:
> from pharaon.engine.php.tokenizer import Tokenizer
> t = Tokenizer("test.php")
> print t.buffer
> 
> but when I run the code it prints None.
> why?? I wrong importing the modules?? 
> 
> bye
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>  

=====
-Premshree
[http://www.qiksearch.com/]

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony



More information about the Python-list mailing list