473,796 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.b uffers import FileBuffer

and then I use the class this way:
class Tokenizer:
def __init__(self, source):
self.buffer = FileBuffer(sour ce)

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 1393
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.b uffers import FileBuffer and then I use the class this way:
class Tokenizer:
def __init__(self, source):
self.buffer = FileBuffer(sour ce)
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.__clas s__

HTH,
Thomas

Jul 18 '05 #2

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

Similar topics

2
2745
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 < importfile.txt But I keep getting timeouts and errors due to the data being too large. I know that since if I break the imported data into multiple chuncks (by importing a few tables at a time) then everything works.
4
4706
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 cell, row by row method. This is fully automated so the user can choose whatever spreadsheet they want to import and press a button which sits on a VB6 frontend. This has been good for that situsation but it can be very slow when there
2
1402
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 .txt file, and then going into the design and changing the field type, but I hit problems on the Numeric fields. Then I tried changing the field types from varchar to different types at the transfom stage of importing, but that failed too.
1
1895
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. for example, the customer would have the info in a standardized format such as a spreadsheet or text file. the customer would submit the file at their convenience within the appication. Somehow the data would eventually imported into the...
7
3066
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 correct cells within that worksheet. The Excel Book is made up of 12 worksheets named Jan-Dec. Each worksheet has columns labeled as each day of that month. Column 'A' is reserved for 19 rows named "room1 - room19". The data I am importing from the...
3
1816
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 but it doesn't. All they have to do now is create a new database using the default wrkgroup, close it and then open it again whilst joined to my workgroup and they can import again. Can someone please help me stop these people importing from the FE...
5
3184
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 in code I can get that table imported without them having to go to options and show hidden tables and then import it manually? dixie
1
2116
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
1973
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 always seem to import the newer version. Is it supposed to? I find that right now I often have to close my iPython window, then reopen it and
3
3005
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 zipcodes. 2) If the last column contains NULL no information is imported. All this with using the Management console using Import data in SQL Server 2005. I am simply trying to import the data into NEW databases.
0
9683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9054
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.