473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Importing problems

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

Jul 18 '05 #1
1 1377
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

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: steve | last post by:
Hi, I have researched but have not found a good solution to this problem. I am importing large amounts of data (over 50 Meg) into a new mysql db that I set up. I use >mysql dbname <...
4
by: Little PussyCat | last post by:
Hello, I nee to write something that will transfer excel data into an SQL Server table. I have for another database application I wrote have it importing Excel spreadsheet data using cell by...
2
by: chudson007 | last post by:
I have a .txt file that I need to add to an existing table, which is made up of Varchar, Char, numeric and int fields. What is the best way to do it. The first thing I tried was importing the...
1
by: Alexander Pope | last post by:
Is there some some standard for this type of database issue? We have an internet application. db2 aix v8.1. was5.0. Our customers want to be able to "upload" or "import" data into our database....
7
by: Darren | last post by:
I have been attempting to create a reservation planning form in excel that imports Data from an Access database and inserts that information automaticly into the correct spreed sheet and the...
3
by: Mark | last post by:
All, As you can see below, I have had problems with inquisitive souls looking at data they shouldn't be. I though disabling the ability to create new databases using my workgroup would stop this...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
1
by: em | last post by:
Hi all, I'm getting some problems importing a DLL that I made in C# within VB6.0. The C# is quite easy, just for trying: namespace TestDll { public class Class1
14
by: T. Crane | last post by:
Hi, When troubleshooting code that's saved in a text file, I often find that I want to make a change to it, re-save it, then reimport it. However, just typing import myTestCode doesn't...
3
by: scoots987 | last post by:
What do others do if you need to import excel files into SQL Server? My main problems are 1) zipcode formatting issues. If the column is a mix of zip and zip+4, I have problems retrieving all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.