Re: [Tutor] Ptyhon GUI doubt

2009-08-26 Thread Alan Gauld
"Reddy Etikela, Rajasekhar" wrote I am new to the Python. I have installed Python 2.6.2 version in windows XP. When I try to open the IDLE(Python GUI), getting the below message. Others have advised what to do for IDLE but since you are on XP I'd strongly recommend using Pythonwin instead o

Re: [Tutor] how to remove first '/'

2009-08-26 Thread Brett Wilkins
I would say the best way would be to use lstrip... path='/path/to/file' stripped_path = path.lstrip('/') Cheers --Brett > Hello, > I want to strip the first '/' from the following: > > '/path/to/file' > > How can I do this? > > Dave > ___ > Tutor mailli

[Tutor] design advise

2009-08-26 Thread davidwilson
Hello, I would like advise on what method would be better in terms of search and retrieval. In my application I need to choose how to store data for each user, for example: /news /articles /games My difficulty now comes in how to store this data in that I will need to create views of the data

[Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Mac Ryan
Hello everybody, I am using "storm" (https://storm.canonical.com/) to manage my database. In storm, relationships between tables (each table is represented by a class) are expressed like this (line #4): 1 >>> class Employee(Person): 2 ... __storm_table__ = "employee" 3 ... company

Re: [Tutor] design advise

2009-08-26 Thread Alan Gauld
wrote In my application I need to choose how to store data for each user, for example: /news /articles /games My difficulty now comes in how to store this data in that I will need to create views Which is the more efficient option for storing this data, is it better to have all in one pl

Re: [Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Wayne
On Wed, Aug 26, 2009 at 11:25 AM, Mac Ryan wrote: > Hello everybody, > >I am using "storm" (https://storm.canonical.com/) to manage my > database. In storm, relationships between tables (each table is > represented by a class) are expressed like this (line #4): > > 1 >>> class Employee(Pe

Re: [Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Kent Johnson
On Wed, Aug 26, 2009 at 12:25 PM, Mac Ryan wrote: > Hello everybody, > >        I am using "storm" (https://storm.canonical.com/) to manage my > database. In storm, relationships between tables (each table is > represented by a class) are expressed like this (line #4): > > 1 >>> class Employee(Pers

Re: [Tutor] design advise

2009-08-26 Thread Kent Johnson
On Wed, Aug 26, 2009 at 7:52 AM, wrote: > Hello, > I would like advise on what method would be better in terms of search and > retrieval. > > In my application I need to choose how to store data for each user, for > example: > > /news > /articles > /games > > My difficulty now comes in how to st

Re: [Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Dave Angel
Kent Johnson wrote: On Wed, Aug 26, 2009 at 12:25 PM, Mac Ryan wrote: Hello everybody, I am using "storm" (https://storm.canonical.com/) to manage my database. In storm, relationships between tables (each table is represented by a class) are expressed like this (line #4): 1 >>> class

Re: [Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Mac Ryan
On Wed, 2009-08-26 at 15:46 -0400, Dave Angel wrote: > So define a classmethod to finish the job, and invoke it later > > class Employee(object): > @classmethod > def finish(cls): > cls.__storm_table__ = "employee" > cls.company_id = [] > cls.company = Company.id

Re: [Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Alan Gauld
"Mac Ryan" wrote 1 >>> class Employee(Person): 2 ... __storm_table__ = "employee" 3 ... company_id = Int() 4 ... company = Reference(company_id, Company.id) where Company is another class. Now, what I noticed is that Company must be declared as a class before Employee, or python w

Re: [Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Kent Johnson
On Wed, Aug 26, 2009 at 5:52 PM, Mac Ryan wrote: > Second thing: the example that Dave gave me and that I left quoted above > makes use of decorators, but this is something that I still do not > understand. I believe I got a grasp of the concept of metaclasses, to > which the concept of decorator s

[Tutor] AUTO: James D Mcclatchey is out of the office. (returning 08/31/2009)

2009-08-26 Thread James D Mcclatchey
I am out of the office until 08/31/2009. I will respond to your message when I return. Note: This is an automated response to your message "Tutor Digest, Vol 66, Issue 72" sent on 8/26/09 17:01:48. This is the only notification you will receive while this person is away. *IMPORTANT NOTICE:

Re: [Tutor] Declaration order of classes... why it is important?

2009-08-26 Thread Dave Angel
Mac Ryan wrote: On Wed, 2009-08-26 at 15:46 -0400, Dave Angel wrote: So define a classmethod to finish the job, and invoke it later class Employee(object): @classmethod def finish(cls): cls.__storm_table__ = "employee" cls.company_id = [] cls.company = Company

[Tutor] Callbacks in Python

2009-08-26 Thread Jramak
Hello I'm confused by callbacks. I would really appreciate any introduction or help in understanding the concept of callbacks. Thanks much Jramak ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Callbacks in Python

2009-08-26 Thread Luke Paireepinart
Suppose you are writing a GUI application. You don't want to write it from scratch so you want to use TKInter or WXPython. However, you also want to process the user's mouse clicks. These clicks won't occur in a consistent manner; sometimes they may occur frequently (double-clicking), sometimes

Re: [Tutor] Callbacks in Python

2009-08-26 Thread Luke Paireepinart
On Wed, Aug 26, 2009 at 8:51 PM, Luke Paireepinart wrote: > > So you write a program that does what you want on each mouse click. > I meant "function" rather than "program". ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/

[Tutor] how do I post event to thread?

2009-08-26 Thread Jeff Peery
hello, I've read a bit about multi thread communication, and found that most people use a queue, which makes sense. however in my case I simply have two threads, a main thread and one other. the main thread is doing many different things and the second thread is receiving numerical data via a se

Re: [Tutor] how do I post event to thread?

2009-08-26 Thread Dave Angel
Jeff Peery wrote: hello, I've read a bit about multi thread communication, and found that most people use a queue, which makes sense. however in my case I simply have two threads, a main thread and one other. the main thread is doing many different things and the second thread is receiving num