Re: Python is overtaking Perl

2007-09-03 Thread nghai
I believe that the time-trend chart show the normalized volumes, relative to the total Google search volume, so a decreasing trend doesn't mean a decreasing absolute volume. The trends of "Los Angeles", "China" searches are decreasing over the last three years, but the absolute volumes should not b

Re: Python is overtaking Perl

2007-09-03 Thread Asun Friere
On Sep 4, 11:49 am, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Who knows? The graph has no labeling or calibration for the y-axis, so > it's meaningless. > Well yes, some calibration would make it more meaningful, but it is at least labeled 'Search Volume.' What's worse the calibration chang

Re: trap setting attribute when the attribute is dict

2007-09-03 Thread yosuke
Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Sep 3, 8:47 pm, <[EMAIL PROTECTED]> wrote: > [...] >> My intention was to have a propery 'sum' in my object, and which has sum >> of all the values() of the dict (i have code to make sure that the value >> of dict are all numeric). I could just th

programming by contract using "decorators"

2007-09-03 Thread Russ
In the thread I started a few days ago, I was told that "programming by contract," could be done with "decorators." I was skeptical that this was a good approach, but as an exercise, I tried to code it up in a reasonably elegant form. I'd like to think I succeeded -- and I must admit that those who

Re: trap setting attribute when the attribute is dict

2007-09-03 Thread yosuke
John Machin <[EMAIL PROTECTED]> wrote: > On Sep 4, 5:47 am, <[EMAIL PROTECTED]> wrote: >> Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> > On Sep 3, 7:00 pm, <[EMAIL PROTECTED]> wrote: >> >> >> I want to do something like this. My class/instance has a dict as a >> >> property. I want the instance

Re: list index()

2007-09-03 Thread TheFlyingDutchman
> > Actually there was. The OP's claim > | There are a million situations where you can have an item not be in > | a list and it is not an exception situation. > > ...is just plain nonsense. zzbbaadd neither does understand exceptions > nor what they are used for in Python. An item not being in a

Re: Python is overtaking Perl

2007-09-03 Thread TheFlyingDutchman
> This chart is showing that amount of python programers is smaller every > year :( I saw an article maybe a year ago, regarding "best careers" that completely contradicted previous articles I had seen in years gone by. It said that the number of people in programming and related jobs would decli

Re: Can you use -getattr- to get a function in the current module?

2007-09-03 Thread Alex Martelli
Sergio Correia <[EMAIL PROTECTED]> wrote: > This works: > > # Module spam.py > > import eggs > > print getattr(eggs, 'omelet')(100) > > That is, I just call the function omelet inside the module eggs and > evaulate it with the argument 100. > > But what if the function 'omelet' is in the modu

Re: py3k - format specifier for strings

2007-09-03 Thread Martin v. Löwis
a = "{0}".format(5.66) a > '5.66' > > There are more options in PEP 3101 (fill, alignment, etc.), but I'm having > trouble implementing them. It would be good if you could describe these troubles in more detail. What have you been trying, what happened, and what did you expect to happen

Re: Can you use -getattr- to get a function in the current module?

2007-09-03 Thread Gabriel Genellina
En Mon, 03 Sep 2007 20:13:43 -0300, Sergio Correia <[EMAIL PROTECTED]> escribi�: > # Module spam.py > > import eggs > > print getattr(eggs, 'omelet')(100) > > That is, I just call the function omelet inside the module eggs and > evaulate it with the argument 100. > > But what if the function 'om

Re: programming by contract using "decorators"

2007-09-03 Thread Michele Simionato
Russ wrote: > Dealing with the arguments was not a trivial matter -- at least not > for me. I had to experiment a bit to get it right. The "getarg" > function is simply a utility for parsing the ordered and keyword > arguments. It's very simple, but if something like this already > exists, please

FCGI app reloading on every request

2007-09-03 Thread John Nagle
I'm converting a web app from CGI to FCGI. The application works fine under FCGI, but it's being reloaded for every request, which makes FCGI kind of pointless. I wrote a little FCGI app which prints when the program is loaded and when it gets a request. And indeed, the program gets reloade

Re: Can you use -getattr- to get a function in the current module?

2007-09-03 Thread Sergio Correia
Alex, Gabriel, Thanks for the reply. Works great! On 9/3/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Mon, 03 Sep 2007 20:13:43 -0300, Sergio Correia > <[EMAIL PROTECTED]> escribi�: > > > # Module spam.py > > > > import eggs > > > > print getattr(eggs, 'omelet')(100) > > > > That is, I j

Re: Applying transformation matrix to 3D vertex coordinates

2007-09-03 Thread Robert Kern
PhilC wrote: > ''' > > Task:- > to apply a translation array to an array > of 3D vertex coordinates to produce the > resulting location of each vertices. > > Translation array and vertex coordinates taken from > a Truespace COB file. > > The text i

Re: FCGI app reloading on every request

2007-09-03 Thread Martin v. Löwis
John Nagle schrieb: >I'm converting a web app from CGI to FCGI. The application works fine > under FCGI, but it's being reloaded for every request, which makes FCGI > kind of pointless. I wrote a little FCGI app which prints when the > program is loaded and when it gets a request. And indeed

Re: list index()

2007-09-03 Thread Carsten Haese
On Mon, 03 Sep 2007 19:56:04 -0700, TheFlyingDutchman wrote > [...] my fork of Python 3, which I am > pleased to announce now, is called Python 3.01 while in development, > and will be known as Python 3000 or Python 3K when it gets to a productional > release. I hope you're joking. -Carsten --

parameter list notation

2007-09-03 Thread TheFlyingDutchman
I am trying to use a database written in Python called buzhug. In looking at some of the functions I see this prototype: def create(self,*fields,**kw): I am not clear on what the * and the ** are for or what they represent. Or, what are they referred to as so I can do a query for information

Re: FCGI app reloading on every request

2007-09-03 Thread John Nagle
Martin v. Löwis wrote: > John Nagle schrieb: > >> I'm converting a web app from CGI to FCGI. The application works fine >>under FCGI, but it's being reloaded for every request, which makes FCGI >>kind of pointless. I wrote a little FCGI app which prints when the >>program is loaded and when it

Re: So what exactly is a complex number?

2007-09-03 Thread Steve Holden
Roy Smith wrote: > Boris Borcic <[EMAIL PROTECTED]> wrote: >> Complex numbers are like a subclass of real numbers > > I wouldn't use the term "subclass". It certainly doesn't apply in the same > sense it applies in OOPLs. For example, you can't say, "All complex > numbers are real numbers".

Re: parameter list notation

2007-09-03 Thread TheFlyingDutchman
Well I did a search on "Python variable length arguments" and found a hit that seems to explain the *fields parameter: When you declare an argment to start with '*', it takes the argument list into an array. def foo(*args): print "Number of arguments:", len(args) print "Arguments are: ", args

Tkinter

2007-09-03 Thread vijayca
i tried to use python gui module Tkinter in solaris,aix,hpux. while importing the module it shows an error... import Tkinter error says that your python may not be configured for Tk()... how to get out of this... -- http://mail.python.org/mailman/listinfo/python-list

Re: So what exactly is a complex number?

2007-09-03 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > but the reals aren't. Clearly you *can* take the square root of all > real numbers, since a real number *is* also a complex number with a > zero imaginary component. They are mathematically equal and equivalent. Ehhh, I let it slide before but since the a

Professional Grant Proposal Writing Workshop (September 2007: Simon Fraser University)

2007-09-03 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held at Simon Fraser University at Harbour Centre, September 12 - 14 , 2007. Interested development professionals, researchers, faculty, and graduate students should register as soon as possible, as demand mean

Re: So what exactly is a complex number?

2007-09-03 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: >> but the reals aren't. Clearly you *can* take the square root of all >> real numbers, since a real number *is* also a complex number with a >> zero imaginary component. They are mathematically equal and equivalent. > > Ehhh, I let it s

Re: parameter list notation

2007-09-03 Thread Steve Holden
TheFlyingDutchman wrote: > Well I did a search on "Python variable length arguments" and found a > hit that seems to explain the *fields parameter: > > When you declare an argment to start with '*', it takes the argument > list into an array. > > def foo(*args): > print "Number of arguments:",

pyPortMidi

2007-09-03 Thread Cappy2112
Does anyone here use pyPortMidi- in particular for Sending/receiving sysex? -- http://mail.python.org/mailman/listinfo/python-list

Re: list index()

2007-09-03 Thread Jason
On Aug 30, 1:27 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 30 Aug 2007 17:09:36 +1000, Ben Finney wrote: > > [EMAIL PROTECTED] writes: > > >> What's with the index() function of lists throwing an exception on not > >> found? > > > It's letting you know that the item isn't in

Re: Python object <-> XML

2007-09-03 Thread Stefan Behnel
Samuel wrote: > Say you have the following XML: > > > item 1 > > > item 2 > > > > > my group > > > Is there an easy way (i.e. without writing a sax/dom parser) to load > this into a (number of) Python object(s), manipulate the instance, and > save the result back to XML? Try lx

Re: Does shuffle() produce uniform result ?

2007-09-03 Thread Antoon Pardon
On 2007-09-03, Paul Rubin wrote: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> If I understand correctly that you are using urandom as a random >> generator I wouldn't trust too much on this performance. Urandom >> uses the systemwide entropy-pool. If other programs need this pool >> too, your pe

Re: Tkinter

2007-09-03 Thread Wildemar Wildenburger
vijayca wrote: > i tried to use python gui module Tkinter in solaris,aix,hpux. > while importing the module it shows an error... > > import Tkinter > error says that your python may not be configured for Tk()... > how to get out of this... > Please copy and paste the invocation and (most imp

Re: Does shuffle() produce uniform result ?

2007-09-03 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > > No the idea is that once there's enough entropy in the pool to make > > one encryption key (say 128 bits), the output of /dev/urandom is > > computationally indistinguishable from random output no matter how > > much data you read from it. > > If you w

The reverse of encode('...', 'backslashreplace')

2007-09-03 Thread Tor Erik Sønvisen
Hi, How can I transform b so that the assertion holds? I.e., how can I reverse the backslash-replaced encoding, while retaining the str-type? >>> a = u'æ' >>> b = a.encode('ascii', 'backslashreplace') >>> b '\\xe6' >>> assert isinstance(b, str) and b == 'æ' Traceback (most recent call last): F

scipy.org website

2007-09-03 Thread Hiten Madhani
Hi, The scipy.org website has been down. Does anyone know whether it is coming back up? Hiten Madhani -- http://mail.python.org/mailman/listinfo/python-list

Re: parameter list notation

2007-09-03 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > In looking at some of the functions I see this prototype: > def create(self,*fields,**kw): > > I am not clear on what the * and the ** are for or what they > represent. It would seem, then, that you haven't followed the exercises in the Python

<    1   2