Re: [Tutor] OOP - have I done it right or could it be better?

2007-01-24 Thread Original Brownster
--- Kent Johnson [EMAIL PROTECTED] wrote: Original Brownster wrote: Hi, I'm fairly new to using OOP and very new to Python, my first program is coming along well and I have split the code into 2 modules. The program finds stream urls, downloads them, re-encodes them to othe

[Tutor] Global values import scope

2007-01-24 Thread Wesley Brooks
Dear Users, I'm using global values to create a unique ID, or name for each instance of a class. If I import the following in one file and test it it works fine. If the following class was imported in two different files run by the same program would each instance of the class have a unique name,

Re: [Tutor] Global values import scope

2007-01-24 Thread Luke Paireepinart
Wesley Brooks wrote: Dear Users, I'm using global values to create a unique ID, or name for each instance of a class. If I import the following in one file and test it it works fine. If the following class was imported in two different files run by the same program would each instance of the

Re: [Tutor] Difference between filter and map

2007-01-24 Thread Kent Johnson
vanam wrote: Yes i did a mistake in expressing my problem below are the instances of the script and its corresponding output,for each instance its giving contrasting result i want explanation for that This has pretty much been explained already. Do you have some question with the

Re: [Tutor] OOP - have I done it right or could it be better?

2007-01-24 Thread Kent Johnson
Original Brownster wrote: --- Kent Johnson [EMAIL PROTECTED] wrote: This all sounds good. You have a module, Streamrip, that implements the core functionality you need. From your description, this module doesn't know about the GUI so it could be reused by another kind of client, tested,

Re: [Tutor] Difference between filter and map

2007-01-24 Thread Alan Gauld
vanam [EMAIL PROTECTED] wrote Yes i did a mistake in expressing my problem below are the instances of the script and its corresponding output,for each instance its giving contrasting result i want explanation for that [1]:def squ(n): return n*n

Re: [Tutor] Python Branches

2007-01-24 Thread Kent Johnson
vanam wrote: i started slowly learning python as i dont have much exposure to it and i wanted to know what are all branches there in python actually i installed py 2.5 recently i come across question in groups about the gui where in pygtk should be installed.My question is without this

Re: [Tutor] Global values import scope

2007-01-24 Thread Kent Johnson
Luke Paireepinart wrote: I believe that, if your program is importing 2 other packages, each of which import some other package, that other doubly-imported package will only be executed once, by whichever one you import first. Yes, that's right. itemID = 0 class AssemblyItem: def

Re: [Tutor] Global values import scope

2007-01-24 Thread Kent Johnson
Wesley Brooks wrote: Dear Users, I'm using global values to create a unique ID, or name for each instance of a class. If I import the following in one file and test it it works fine. If the following class was imported in two different files run by the same program would each instance of

Re: [Tutor] Python Branches

2007-01-24 Thread Alan Gauld
vanam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] i started slowly learning python as i dont have much exposure to it and i wanted to know what are all branches there in python I assume by branches you mean all the different libraries available? Thats difficult to answer

[Tutor] Python code to connect using PPPoE

2007-01-24 Thread Johan Geldenhuys
Hi all, I don't know if this the right place to ask the question, but I did some Googling and struggled to get decent examples of code to use for PPPoE connection. I have a wireless modem that uses PPPoE to connect and want to use Python to connect to the internet through this modem using

Re: [Tutor] Python code to connect using PPPoE

2007-01-24 Thread Kent Johnson
Johan Geldenhuys wrote: Hi all, I don't know if this the right place to ask the question, but I did some Googling and struggled to get decent examples of code to use for PPPoE connection. I have a wireless modem that uses PPPoE to connect and want to use Python to connect to the

Re: [Tutor] Python code to connect using PPPoE

2007-01-24 Thread Johan Geldenhuys
Kent, I want to establish the connection with Python. I think in Linux you can use a PPPoE package to make life easier, but I don't want to use the Kernel to do that. Johan -Original Message- From: Kent Johnson [mailto:[EMAIL PROTECTED] Sent: 24 January 2007 03:52 PM To: [EMAIL

Re: [Tutor] Global values import scope

2007-01-24 Thread Wesley Brooks
Thanks for your help I tested what you two said as follows and it worked great. Thank you. (Bellow in file TEST_ClassID.py) class AssemblyItem: itemID = 0 def __init__(self): self.ID = assemblyItem + str(AssemblyItem.itemID) AssemblyItem.itemID += 1 def

Re: [Tutor] Global values import scope

2007-01-24 Thread Kent Johnson
Wesley Brooks wrote: Thanks for your help I tested what you two said as follows and it worked great. Thank you. (Bellow in file TEST_ClassID.py) class AssemblyItem: itemID = 0 def __init__(self): self.ID = assemblyItem + str(AssemblyItem.itemID)

Re: [Tutor] Python code to connect using PPPoE

2007-01-24 Thread Kent Johnson
Johan Geldenhuys wrote: Kent, I want to establish the connection with Python. I think in Linux you can use a PPPoE package to make life easier, but I don't want to use the Kernel to do that. If you are on Linux, maybe you can use os.command() to control rp-pppoe.

Re: [Tutor] Python code to connect using PPPoE

2007-01-24 Thread Johan Geldenhuys
Is there a module that I can use for this or is it a os function? Johan -Original Message- From: Kent Johnson [mailto:[EMAIL PROTECTED] Sent: 24 January 2007 04:39 PM To: [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] Python code to connect using PPPoE Johan Geldenhuys

Re: [Tutor] Python code to connect using PPPoE

2007-01-24 Thread Kent Johnson
Johan Geldenhuys wrote: Is there a module that I can use for this or is it a os function? I haven't found any module for Linux. Kent Johan -Original Message- From: Kent Johnson [mailto:[EMAIL PROTECTED] Sent: 24 January 2007 04:39 PM To: [EMAIL PROTECTED] Cc:

Re: [Tutor] metaclass question

2007-01-24 Thread Kent Johnson
Kim Branson wrote: Hi, what i've ended up doing is the following define a EmpiricalScore class that has all the methods for computing results define a single method in the evaluation class that is called Score. This method simply walks though a list and executes the methods in

[Tutor] Python connecting to an exchange server

2007-01-24 Thread Jalil
I just wanted to know if its possible or if anyone can point me to a place where I can get info on howto to get python to talk to an MS exchange server. I would basically want the python code to parse the appointsments in my outlook calendar. Is this possible? Thank You -- Shoot for the

Re: [Tutor] Python connecting to an exchange server

2007-01-24 Thread Ted Roche
On 1/24/07, Jalil [EMAIL PROTECTED] wrote: I would basically want the python code to parse the appointsments in my outlook calendar. Then it's most likely you don't want to talk to exchange at all, but rather talk with Outlook. Outlook supports a COM Automation interface and you can use it

[Tutor] Cause-Effect, Isikawa, fishbone diagram

2007-01-24 Thread János Juhász
Dear All, does someone know any python based solution to draw a cause-effect diagram into PDF from a simple textfile ? It is also called a Fishbone Diagram, because of its shape, or an Ishikawa Chart, after its originator, Kaoru Ishikawa I feel, it can be converted from a structure like this.

[Tutor] Tracking time

2007-01-24 Thread Michael Key
I am trying to develop a project tracking program that would allow you to track hours and minutes spent on several different projects and store he data in a database for printing. Any help would be appreciated. Mike___ Tutor maillist -

Re: [Tutor] Tracking time

2007-01-24 Thread Luke Paireepinart
Michael Key wrote: I am trying to develop a project tracking program that would allow you to track hours and minutes spent on several different projects and store he data in a database for printing. Any help would be appreciated. You could store the start time using the time module. when

Re: [Tutor] Send binary/hex data to a TCP socket

2007-01-24 Thread Adam Bark
On 25/01/07, Tod Haren [EMAIL PROTECTED] wrote: I need to send a server at the other end of a socket a 36 byte frame, where each byte represents a specific field in the custom data structure.(If there are any Ham operators reading this, I'm talking about the AGW Packet Engine) The

[Tutor] Best IDE for Python

2007-01-24 Thread Shadab Sayani
Hi, I am using vim editor to code my project in python.Is there a good IDE where in I type the name of the class object and then dot then all the attributes of the object are displayed so on.I tried to install IDLE but I have no idea how to install tkinter? Any help that enables me to

[Tutor] Optimal solution in dealing with huge databases in python

2007-01-24 Thread Shadab Sayani
Hi, I am working in a biodatabases project.The data I need to deal with is in 100s of GB.I am using postgresql backend and SQLALCHEMY ORM.I need to read the bio datafiles and parse them and then store them in database.I am in the process of storing them. I used the session,flush concept

Re: [Tutor] Tracking time

2007-01-24 Thread johnf
On Wednesday 24 January 2007 14:34, Michael Key wrote: I am trying to develop a project tracking program that would allow you to track hours and minutes spent on several different projects and store he data in a database for printing. Any help would be appreciated. Mike Take a good look at

Re: [Tutor] Best IDE for Python

2007-01-24 Thread Dick Moores
At 07:12 PM 1/24/2007, Shadab Sayani wrote: Hi, I am using vim editor to code my project in python.Is there a good IDE where in I type the name of the class object and then dot then all the attributes of the object are displayed so on. I believe IPython does this. Check out

[Tutor] Python re without string consumption

2007-01-24 Thread Jacob Abraham
Dear Tutors, I'm having a little trouble while using the re module. eg import re re.findall(abca, abcabcabca) [abca, abca] While I am expecting. [abca, abca, abca] How do I modify my regular expression to do the same. Thanks for the help. Regards, Jacob Abraham

Re: [Tutor] Python re without string consumption

2007-01-24 Thread Danny Yoo
On Wed, 24 Jan 2007, Jacob Abraham wrote: import re re.findall(abca, abcabcabca) [abca, abca] While I am expecting. [abca, abca, abca] Hi Jacob, Just to make sure: do you understand, though, why findall() won't give you the results you want? The documentation on findall() says:

Re: [Tutor] Python re without string consumption

2007-01-24 Thread Jacob Abraham
Hi Danny Yoo, I would like to thank you for the solution and the helper funtion that I have written is as follows. But I do hope that future versions of Python include a regular expression syntax to handle such cases simply because this method seems very process and memory intensive. I also