Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread Wildemar Wildenburger
Diez B. Roggisch wrote: > Deprecated doesn't mean it's not available. Is that so? ;) But it certainly means that some time in the not-too-distant future "apply" will vanish. > And even if it goes away, > you can simply write it yourself: > > def apply(f, *args, **kwargs): > return f(*args,

Re: Lists vs tuples (newbie)

2007-05-23 Thread Tim Roberts
Neil Cerutti <[EMAIL PROTECTED]> wrote: > >I use tuples simply because of their mellifluous appellation. +1 QOTW. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing iTunes with Python via the Windows SDK

2007-05-23 Thread Denrael
On May 24, 12:17 am, Tony Meyer <[EMAIL PROTECTED]> wrote: > On May 24, 4:23 pm, Denrael <[EMAIL PROTECTED]> wrote:> I've been playing > with the iTunes sdk on windows, and have come across > > a strange problem. With the following code: > > The object you get back from iTunes.CurrentTrack (the t

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
On May 23, 10:44 pm, mkPyVS <[EMAIL PROTECTED]> wrote: So the issue was that the min-size of the content panel actually limits the size of the listview control. Once the minsize attribute is modified in the listbook panels the listview can then be resized to be wider on callback or with a custom s

Re: Accessing iTunes with Python via the Windows SDK

2007-05-23 Thread Tony Meyer
On May 24, 4:23 pm, Denrael <[EMAIL PROTECTED]> wrote: > I've been playing with the iTunes sdk on windows, and have come across > a strange problem. With the following code: > > import win32com.client > iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application") > curr = iTunes.CurrentT

Re: 0 == False but [] != False?

2007-05-23 Thread Erik Max Francis
Rajarshi wrote: > This is a slightly naive question, but I know that 0 can be used to > represent False. So > 0 == False > True > > But, I know I can use [] to represent False as in > if not []: print 'empty' > ... > empty > > But then doing the following gives a surprising (to me!)

Re: 0 == False but [] != False?

2007-05-23 Thread Paul McGuire
On May 23, 11:53 pm, Rajarshi <[EMAIL PROTECTED]> wrote: > This is a slightly naive question, but I know that 0 can be used to > represent False. So > > >>> 0 == False > > True > > But, I know I can use [] to represent False as in > > >>> if not []: print 'empty' > > ... > empty > > But then doing

Re: 0 == False but [] != False?

2007-05-23 Thread Raymond Hettinger
> >>> [] == False > False > > Could anybody point out why this is the case? Writing, "if x" is short for writing "if bool(x)". Evaluating bool(x) checks for a x.__nonzero__() and if that method isn't defined, it checks for x.__len__() to see if x is a non-empty container. In your case, writing "i

Re: 0 == False but [] != False?

2007-05-23 Thread James Stroud
Rajarshi wrote: > This is a slightly naive question, but I know that 0 can be used to > represent False. So > > 0 == False > > True > > But, I know I can use [] to represent False as in > > if not []: print 'empty' > > ... > empty > > But then doing the following gives a surprising

Re: 0 == False but [] != False?

2007-05-23 Thread Robert Kern
Rajarshi wrote: > This is a slightly naive question, but I know that 0 can be used to > represent False. So > 0 == False > True > > But, I know I can use [] to represent False as in > if not []: print 'empty' > ... > empty > > But then doing the following gives a surprising (to me!) r

0 == False but [] != False?

2007-05-23 Thread Rajarshi
This is a slightly naive question, but I know that 0 can be used to represent False. So >>> 0 == False True But, I know I can use [] to represent False as in >>> if not []: print 'empty' ... empty But then doing the following gives a surprising (to me!) result >>> [] == False False Could anyb

Re: using google search api for python

2007-05-23 Thread John Nagle
Vyacheslav Maslov wrote: > Gerardo Herzig wrote: > >> Hi all. Im looking for the pyGoogle for making google searchs y a >> python script. The thing is, all im founding is an AJAX api, but the >> application ill use is NOT a web app. So, someone know if there is a >> pure python api that i can d

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
On May 23, 1:47 pm, [EMAIL PROTECTED] wrote: > Wow! You sure like to post a lot! Sheesh! I subscribe to the wxPython > user's group and I don't see your post anywhere. Yeah sorry.. google groups was giving me repeated errors on post... frustration clicking took over and viola... 17 posts- my apolo

ValueError: need more than 1 value to unpack

2007-05-23 Thread laxmikiran . bachu
ValueError: need more than 1 value to unpack . This is the error I get when I am using pyRXPU in the one of the scripts to get the strings from an application. Can anybody throw some light on this ..what might be the solution for this. If I use pyRXP iam not getting the mentioned error. Error inf

Accessing iTunes with Python via the Windows SDK

2007-05-23 Thread Denrael
I've been playing with the iTunes sdk on windows, and have come across a strange problem. With the following code: import win32com.client iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application") curr = iTunes.CurrentTrack name = curr.Name skipped = curr.SkippedCount skipdate = curr.

Re: read file to a dictionary

2007-05-23 Thread 7stud
On May 23, 6:46 pm, James Stroud <[EMAIL PROTECTED]> wrote: lol -- http://mail.python.org/mailman/listinfo/python-list

Can not access pygame.org

2007-05-23 Thread Eiwot
Hi all, I can not access pygame.org. Anyone saw this problem ? Check out http://pyarticles.blogspot.com Cheers _ Download Messenger. Start an i’m conversation. Support a cause. Join now. http://im.live.com/messenger/im/home/?s

Re: using google search api for python

2007-05-23 Thread Vyacheslav Maslov
Gerardo Herzig wrote: > Hi all. Im looking for the pyGoogle for making google searchs y a python > script. The thing is, all im founding is an AJAX api, but the > application ill use is NOT a web app. So, someone know if there is a > pure python api that i can download and use? > > Thanks! > Ge

Re: Parallel/distributed generator

2007-05-23 Thread Simon Brunning
On 23 May 2007 11:00:56 -0700, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, i.e. > http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. Kamaelia? http://tiny

New update on Python

2007-05-23 Thread Eiwot
Hi New update at http://pyarticles.blogspot.com . Check it out Cheers _ Create the ultimate e-mail address book. Import your contacts to Windows Live Hotmail. www.windowslive-hotmail.com/learnmore/managemail2.html?locale=en-us&

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 1:22 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 23, 2:58 pm, [EMAIL PROTECTED] wrote: > > > > > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > I'm looking for any existing packages or ideas on how to implement the > > > equivalent of a generator (in the P

Re: how to use imaageop.scale

2007-05-23 Thread Bruce
On May 23, 5:31 pm, "Amit Khemka" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 00:02:34 -0700, Bruce <[EMAIL PROTECTED]> wrote: > > > Hi, I want to compress a jpg file. e.g. a jpg file which has RGB band > > (24bit per pixel), 100 * 100 size to 50 * 50 size. I > > tried to use scale function in imag

Re: How to release the GIL from C?

2007-05-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roger Binns wrote: > I am trying to release the GIL in a multi-threaded program (efforts > detailed below) without any success. The ultimate cause was that the program forked to go into daemon mode. I had called PyOS_AfterFork() as the documents direc

Re: read file to a dictionary

2007-05-23 Thread James Stroud
rohit wrote: > i want to implement a dictionary in python > the query is : > without explicitly doing the following steps > 1. reading from file to list > 2. processing list to dictionary > is there a module or a built in function that helps me "read" a file > directly into a dictionary > or any m

Re: Creating Graphs for the Web

2007-05-23 Thread James Stroud
Michael Bentley wrote: > > On May 23, 2007, at 4:17 PM, erikcw wrote: > >> I'm working on a django powered website, and need to dynamically >> generate some graphs (bar, pie, and line) from users' data stored in >> MySQL. >> >> Can anyone recommend a good library I can use for this? > > > Matpl

Re: Call script which accepts com. line par. from another script and error control

2007-05-23 Thread James Stroud
Karim Ali wrote: > def MAIN(expression2parse)<- add a main so can > call from other script Of course you don't mean you want another python interpreter to fire up and run the other script? Here is an example of the way to do what you are suggesting: # mod1.py def doit(

Call script which accepts com. line par. from another script and error control

2007-05-23 Thread Karim Ali
Hi, I would really appreciate help on this. I have a script (s1.py) which I would like to call from another script (s2.py). No problem there. The first issue is that s1.py has a command line parser which I would like to keep but instead of fetching the information from the command line, I woul

Re: read file to a dictionary

2007-05-23 Thread Larry Bates
rohit wrote: > i want to implement a dictionary in python > the query is : > without explicitly doing the following steps > 1. reading from file to list > 2. processing list to dictionary > is there a module or a built in function that helps me "read" a file > directly into a dictionary > or any m

Re: Basic Class/Instance Question

2007-05-23 Thread Maric Michaud
Alan Franzoni a écrit : > Il 23 May 2007 04:53:55 -0700, Siah ha scritto: > > [cut] > > No. > > It's because the *body* of the function gets evaluated every time the > function is called, while the *definition* of the function gets evaluated > just once, when the function is 'declared'. > > You

Re: using google search api for python

2007-05-23 Thread Maric Michaud
Larry Bates a écrit : > Gerardo Herzig wrote: >> Hi all. Im looking for the pyGoogle for making google searchs y a python >> script. The thing is, all im founding is an AJAX api, but the >> application ill use is NOT a web app. So, someone know if there is a >> pure python api that i can download a

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-23 Thread Maric Michaud
Stef Mientki a écrit : > hi Bruno, > > after study it carefully, > it's much more complex than I thought > (I can't understand it completely, which is of less importance). > Your solution works great, > but I need one little extension, > which I can create, but just at the cost of a lot of code. >

read file to a dictionary

2007-05-23 Thread rohit
i want to implement a dictionary in python the query is : without explicitly doing the following steps 1. reading from file to list 2. processing list to dictionary is there a module or a built in function that helps me "read" a file directly into a dictionary or any module that implements the abo

Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread George Sakkis
On May 23, 6:22 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > It is that very apply. > > > And apply takes a function as argument + additional arguments, and executes > > that function, returning the result of that function-call. It was used > > before the > > >

Re: Parallel/distributed generator

2007-05-23 Thread Diez B. Roggisch
George Sakkis schrieb: > On May 23, 2:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> George Sakkis wrote: >>> I'm looking for any existing packages or ideas on how to implement the >>> equivalent of a generator (in the Python sense, i.e. >>> http://www.python.org/dev/peps/pep-0255/) in

Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread Diez B. Roggisch
Wildemar Wildenburger schrieb: > Diez B. Roggisch wrote: >> It is that very apply. >> >> And apply takes a function as argument + additional arguments, and >> executes >> that function, returning the result of that function-call. It was used >> before the >> f(*args, **kwargs) >> >> notation was i

Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread Wildemar Wildenburger
Diez B. Roggisch wrote: > It is that very apply. > > And apply takes a function as argument + additional arguments, and executes > that function, returning the result of that function-call. It was used > before the > > f(*args, **kwargs) > > notation was introduced. > > Now what we have here is "v

Re: NOOOOB

2007-05-23 Thread Basilisk96
On May 22, 5:44 pm, [EMAIL PROTECTED] wrote: > On May 22, 6:29 am, jolly <[EMAIL PROTECTED]> wrote: > > > Hey guys, > > > I want to begin python. Does anyone know where a good starting point > > is? > > > Thanks, > > Jem > > I really liked How to Think Like a Computer Scientist learning with > pyth

Re: Parallel/distributed generator

2007-05-23 Thread George Sakkis
On May 23, 4:22 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 23, 2:58 pm, [EMAIL PROTECTED] wrote: > > > > > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > I'm looking for any existing packages or ideas on how to implement the > > > equivalent of a generator (in the P

Re: Creating Graphs for the Web

2007-05-23 Thread Michael Bentley
On May 23, 2007, at 4:17 PM, erikcw wrote: > I'm working on a django powered website, and need to dynamically > generate some graphs (bar, pie, and line) from users' data stored in > MySQL. > > Can anyone recommend a good library I can use for this? Matplotlib! -- http://mail.python.org/mailm

Re: Parallel/distributed generator

2007-05-23 Thread George Sakkis
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote: > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > I'm looking for any existing packages or ideas on how to implement the > > equivalent of a generator (in the Python sense, > > i.e.http://www.python.org/dev/peps/pep-0255/) in a p

Creating Graphs for the Web

2007-05-23 Thread erikcw
Hi, I'm working on a django powered website, and need to dynamically generate some graphs (bar, pie, and line) from users' data stored in MySQL. Can anyone recommend a good library I can use for this? Thanks! Erik -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel/distributed generator

2007-05-23 Thread George Sakkis
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote: > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > I'm looking for any existing packages or ideas on how to implement the > > equivalent of a generator (in the Python sense, > > i.e.http://www.python.org/dev/peps/pep-0255/) in a p

Re: Parallel/distributed generator

2007-05-23 Thread George Sakkis
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote: > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > I'm looking for any existing packages or ideas on how to implement the > > equivalent of a generator (in the Python sense, > > i.e.http://www.python.org/dev/peps/pep-0255/) in a p

Re: Parallel/distributed generator

2007-05-23 Thread George Sakkis
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote: > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > I'm looking for any existing packages or ideas on how to implement the > > equivalent of a generator (in the Python sense, > > i.e.http://www.python.org/dev/peps/pep-0255/) in a p

Re: Parallel/distributed generator

2007-05-23 Thread George Sakkis
On May 23, 2:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > I'm looking for any existing packages or ideas on how to implement the > > equivalent of a generator (in the Python sense, i.e. > >http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > > wa

Re: Parallel/distributed generator

2007-05-23 Thread George Sakkis
On May 23, 2:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > I'm looking for any existing packages or ideas on how to implement the > > equivalent of a generator (in the Python sense, i.e. > >http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > > wa

Re: Inverse of id()?

2007-05-23 Thread Paul McGuire
On May 21, 4:55 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 20 May, 01:42, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > > > >>> re = Regex("(\d*)").setResultsName("x").setParseAction(lambda > > >>> t:int(t[0])) > > >>> results = re.parseString("123") > > > pyparsing results have some special

Re: converting text and spans to an ElementTree

2007-05-23 Thread Steven Bethard
Neil Cerutti wrote: > On 2007-05-22, Steven Bethard <[EMAIL PROTECTED]> wrote: >> Thanks a lot! This put me on the right track (though the >> devil's definitely in the details). It's working now:: >> >> > tree = xmltools.text_and_spans_to_etree('aaa aaa aaaccc cccaaa', [ >> ... (etree.Eleme

How to release the GIL from C?

2007-05-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I am trying to release the GIL in a multi-threaded program (efforts detailed below) without any success. In the main thread during startup, I do the following: Py_InitializeEx(0); /* Python shouldn't handle signals */ PyEval_InitThreads(); /*

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread Paul McGuire
On May 23, 2:58 pm, [EMAIL PROTECTED] wrote: > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > > > I'm looking for any existing packages or ideas on how to implement the > > equivalent of a generator (in the Python sense, > > i.e.http://www.python.org/dev/peps/pep-0255/) in

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Resizing listbook's listview pane

2007-05-23 Thread kyosohma
On May 23, 11:53 am, mkPyVS <[EMAIL PROTECTED]> wrote: > On May 23, 9:04 am, [EMAIL PROTECTED] wrote: > > > Which Python gui toolkit are you using? Tkinter, wxPython, pyQT? Are > > you wanting the resize to happen programmatically, when the user > > changes the app's size, both or what? > > > More

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Namespace issue

2007-05-23 Thread 7stud
On May 23, 12:20 pm, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > As per my understanding, the bad part is that on every call of the method > FetchData(), an import would be done. > > To not let that happen, I can put the import into __init__(). But when I put > in there, I get a NameError saying

Re: Namespace issue

2007-05-23 Thread 7stud
On May 23, 12:20 pm, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > As per my understanding, the bad part is that on every call of the method > FetchData(), an import would be done. > > To not let that happen, I can put the import into __init__(). But when I put > in there, I get a NameError saying

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 2:24 pm, Lyosha <[EMAIL PROTECTED]> wrote: > On May 23, 12:19 pm, Lyosha <[EMAIL PROTECTED]> wrote: > > > > > On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > > > > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > > On 23 May 2007 11:31:56 -0700, Mangabasi <

Re: Namespace issue

2007-05-23 Thread 7stud
On May 23, 12:20 pm, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > As per my understanding, the bad part is that on every call of the method > FetchData(), an import would be done. > > To not let that happen, I can put the import into __init__(). But when I put > in there, I get a NameError saying

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 2:19 pm, Lyosha <[EMAIL PROTECTED]> wrote: > On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > > > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > > > When I modified this to: > > > >

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Lyosha
On May 23, 12:19 pm, Lyosha <[EMAIL PROTECTED]> wrote: > On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > > > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > > > When I modified this to: > > > >

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Lyosha
On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > > When I modified this to: > > > > class Point(list): > > > def __init__(self,x,y): > > >

Re: Namespace issue

2007-05-23 Thread kyosohma
On May 23, 1:20 pm, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > Hi, > > I need a little help in understanding how Namespaces and scoping works with > Classes/Functions in Python. > > Here's my code: > class FetchData: > def __init__(self, dataTypes=["foo", "bar", "spam"], archive=False): > >

Re: Namespace issue

2007-05-23 Thread kyosohma
On May 23, 1:20 pm, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > Hi, > > I need a little help in understanding how Namespaces and scoping works with > Classes/Functions in Python. > > Here's my code: > class FetchData: > def __init__(self, dataTypes=["foo", "bar", "spam"], archive=False): > >

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Lyosha
On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > > When I modified this to: > > > > class Point(list): > > > def __init__(self,x,y): > > >

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Lyosha
On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > > When I modified this to: > > > > class Point(list): > > > def __init__(self,x,y): > > >

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > When I modified this to: > > > class Point(list): > > def __init__(self,x,y): > > super(Point, self).__init__([x, y]) > > self.x = x > >

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > When I modified this to: > > > class Point(list): > > def __init__(self,x,y): > > super(Point, self).__init__([x, y]) > > self.x = x > >

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-23 Thread Stef Mientki
hi Bruno, after study it carefully, it's much more complex than I thought (I can't understand it completely, which is of less importance). Your solution works great, but I need one little extension, which I can create, but just at the cost of a lot of code. Maybe you can give me another hint. > I

* Unlimited BARTAB!

2007-05-23 Thread creamy . loads
http://hootys.blogspot.com/ - Free Downloads! Amazing Deals. -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Jerry Hill
On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > When I modified this to: > > class Point(list): > def __init__(self,x,y): > super(Point, self).__init__([x, y]) > self.x = x > self.y = y > > It worked. Are you sure? >>> p = Point(10, 20) >>> p [10,

Namespace issue

2007-05-23 Thread Ritesh Raj Sarraf
Hi, I need a little help in understanding how Namespaces and scoping works with Classes/Functions in Python. Here's my code: class FetchData: def __init__(self, dataTypes=["foo", "bar", "spam"], archive=False): self.List = [] self.Types = dataTypes if

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regular lists have. > > Like this: > > class

Re: Slightly OT: Why all the spam?

2007-05-23 Thread Joel Hedlund
> Then they aren't expired. If they were expired, you wouldn't > see them. Alright, so the solution is not to browse c.l.p articles newer than a week while the boss is behind your back then. :-) Thanks for educating a usenet white belt though! /Joel -- http://mail.python.org/mailman/listinfo/

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regular lists have. > > Like this: > > class

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regular lists have. > > Like this: > > class

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regular lists have. > > Like this: > > class

Re: Parallel/distributed generator

2007-05-23 Thread Diez B. Roggisch
George Sakkis wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, i.e. > http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a function that generates a range of > primes. I'

Re: dabo framework dependancies

2007-05-23 Thread Paul McNett
Peter Decker wrote: > On 5/22/07, daniel gadenne <[EMAIL PROTECTED]> wrote: > >> I'm considering moving over to dabo for wxpython development. >> However I do not write traditional database applications >> à la foxpro (I'm a 20 years user of fox...) anymore. >> Only xml-fed applications. >> >> I'm

Parallel/distributed generator

2007-05-23 Thread George Sakkis
I'm looking for any existing packages or ideas on how to implement the equivalent of a generator (in the Python sense, i.e. http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed way. As a use case, imagine a function that generates a range of primes. I'd like to be able to do somethin

Re: Inheriting from Python list object(type?)

2007-05-23 Thread km
Hi, u have the answer in ur question itself :) u dont need to redefine list methods again - just inherit from the builtin-list-type. try this with new style classes: code ### class Point(list): def __init__(self,x,y): super(Point, self).__init__() self.x = x self.y

f.readline(), for line in f

2007-05-23 Thread 7stud
Hi, 1) Does this make any sense: """ Thus, the loop: for line in f: iterates on each line of the file. Due to buffering issues, interrupting such a loop prematurely(e.g. with break), or calling f.next() instead of f.readline(), leaves the files position set to an arbitrary value. """ The

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Jerry Hill
On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > There must be a way to inherit from the list type without having to > redefine all the methods and attributes that regular lists have. Like this: class Point(list): def __init__(self, x, y, z = 1): list.__init__(sel

Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread Brian van den Broek
Peter Otten said unto the world upon 05/23/2007 01:32 PM: > Brian van den Broek wrote: >> Help on built-in function apply in module __builtin__: >> >> But: >> >> >>> [x for x in dir('__builtin__') if 'apply' in x] >> [] >> >> ? If apply is in the __builtin__ module, why doesn't >> dir('__built

Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread Peter Otten
Brian van den Broek wrote: > I had the same sort of question as Wildemar and I set about > investigating as any good pythonista would by typing help(apply) at > the interactive prompt. That produced a help text that started: > > Help on built-in function apply in module __builtin__: > > But: >

CP4E revival

2007-05-23 Thread Michael Tobis
Is education Python's killer app? I think it could be. I used the occasion of the Python Papers to motivate my efforts, and you can see what I came up with here on pages 8-15. The part that makes me especially queasy is the CP4E section on pages 10-11. I wish I had more to say there. It's fairly

Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
Howdy, I would like to create a Point class that lets me use Point instances like the following example. >>> p = Point(3, 4) >>> p.x 3 >>> p.y 4 >>> p.z 1 >>> p[0] 3 >>> p[1] 4 >>> p[1] = 5 >>> p.y 5 >>> other than the x, y, z attributes, these instances should behave like regular Python lists.

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
On May 23, 9:04 am, [EMAIL PROTECTED] wrote: > Which Python gui toolkit are you using? Tkinter, wxPython, pyQT? Are > you wanting the resize to happen programmatically, when the user > changes the app's size, both or what? > > More details would be helpful. > > Mike Sorry, copied from wxpython sub

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
On May 23, 9:04 am, [EMAIL PROTECTED] wrote: > Which Python gui toolkit are you using? Tkinter, wxPython, pyQT? Are > you wanting the resize to happen programmatically, when the user > changes the app's size, both or what? > > More details would be helpful. > > Mike Sorry, copied from wxpython sub

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-05-23 Thread Larry Clapp
["Followup-To:" header set to comp.lang.lisp.] On 2007-05-23, Xah Lee <[EMAIL PROTECTED]> wrote: > The Concepts and Confusions of Prefix, Infix, Postfix and Fully > Functional Notations > > Xah Lee, 2006-03-15 Xah, why do you post year-old essays to newsgroups that couldn't care less about them?

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
On May 23, 9:04 am, [EMAIL PROTECTED] wrote: > Which Python gui toolkit are you using? Tkinter, wxPython, pyQT? Are > you wanting the resize to happen programmatically, when the user > changes the app's size, both or what? > > More details would be helpful. > > Mike Sorry, copied from wxpython sub

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
On May 23, 9:04 am, [EMAIL PROTECTED] wrote: > Which Python gui toolkit are you using? Tkinter, wxPython, pyQT? Are > you wanting the resize to happen programmatically, when the user > changes the app's size, both or what? > > More details would be helpful. > > Mike Sorry, copied from wxpython sub

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
On May 23, 9:04 am, [EMAIL PROTECTED] wrote: > Which Python gui toolkit are you using? Tkinter, wxPython, pyQT? Are > you wanting the resize to happen programmatically, when the user > changes the app's size, both or what? > > More details would be helpful. > > Mike Sorry, copied from wxpython sub

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
Sorry, copied from wxpython submit as well.. I'm using wxpython 2.8... Primariy I want the resize to happen programatically during object creation/post creation... I can worry about app size changes later. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
Sorry, copied from wxpython submit as well.. I'm using wxpython 2.8... Primariy I want the resize to happen programatically during object creation/post creation... I can worry about app size changes later. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
Sorry, copied from wxpython submit as well.. I'm using wxpython 2.8... Primariy I want the resize to happen programatically during object creation/post creation... I can worry about app size changes later. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
Sorry, copied from wxpython submit as well.. I'm using wxpython 2.8... Primariy I want the resize to happen programatically during object creation/post creation... I can worry about app size changes later. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Resizing listbook's listview pane

2007-05-23 Thread mkPyVS
Sorry, copied from wxpython submit as well.. I'm using wxpython 2.8... Primariy I want the resize to happen programatically during object creation/post creation... I can worry about app size changes later. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >