Importing problems

Thomas Guettler guettli at thomas-guettler.de
Mon Nov 8 12:34:01 CET 2004


Am Sat, 06 Nov 2004 06:53:02 -0800 schrieb Gabriele *darkbard* Farina:

> Hi
> 
> I've my application filesystem structured like this:

...
 
> 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)

The indentation got lost.

> In 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?? 

What does this print?
print t.buffer.__class__

HTH,
 Thomas




More information about the Python-list mailing list