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

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

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

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

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 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: 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: 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

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: 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:",

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

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 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

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: 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

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: 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

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: 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 --

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: 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: 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

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: 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

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: 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 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: 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: 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: 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

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
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

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: 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

py3k - format specifier for strings

2007-09-03 Thread Carl Trachte
Hello. Python 3.0.a1 has been released. I'm trying to get the hang of the new string formatting in the form: >>> 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. The doc has not yet been written. I haven't

Re: So what exactly is a complex number?

2007-09-03 Thread Roy Smith
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". In fact, just the opposite.

Re: Python is overtaking Perl

2007-09-03 Thread Erik Max Francis
Asun Friere wrote: > How do you figure that? Isn't the chart showing the frequency of > those particular terms combined as a fraction of the total search > volume on Google? Who knows? The graph has no labeling or calibration for the y-axis, so it's meaningless. -- Erik Max Francis && [EMAIL

Re: Python is overtaking Perl

2007-09-03 Thread Asun Friere
On Sep 4, 10:49 am, Sulsa <[EMAIL PROTECTED]> wrote: > On Tue, 04 Sep 2007 00:32:23 - > > Ben <[EMAIL PROTECTED]> wrote: > > Here are the statistics from Google Trends: > > >http://benyang22a.blogspot.com/2007/09/perl-vs-python.html > > This chart is showing that amount of python programers is

Re: Python is overtaking Perl

2007-09-03 Thread Sulsa
On Tue, 04 Sep 2007 00:32:23 - Ben <[EMAIL PROTECTED]> wrote: > Here are the statistics from Google Trends: > > http://benyang22a.blogspot.com/2007/09/perl-vs-python.html > This chart is showing that amount of python programers is smaller every year :( -- http://mail.python.org/mailman/lis

Re: metaclasses: timestamping instances

2007-09-03 Thread Gabriel Genellina
En Mon, 03 Sep 2007 07:39:05 -0300, km <[EMAIL PROTECTED]> escribi�: > But why does it show varied difference in the time between a and b > instance creations when __metaclass__ hook is used and when not used in > class Y ? I dont understand that point ! What do you expect from a._created, b.

Re: [Crew] Four Years of Starship hosting come to an end

2007-09-03 Thread Christian Tismer
Stefan Drees wrote: > Dear Crew of the Python Starship, > > after a short email exchange of thoughts with Christian Tismer, that he > might take over again the hosting of the ship or silently give over some > of its remains to a museum, he encouraged me, to let go after four years > of hosting,

Python is overtaking Perl

2007-09-03 Thread Ben
Here are the statistics from Google Trends: http://benyang22a.blogspot.com/2007/09/perl-vs-python.html -- http://mail.python.org/mailman/listinfo/python-list

Re: SOAP : ZSI error

2007-09-03 Thread Gabriel Genellina
En Mon, 03 Sep 2007 06:43:27 -0300, linuxprog <[EMAIL PROTECTED]> escribi�: > import IDutchservice_services > soap = > IDutchservice_services.IDutchbindingSOAP("www.ebob42.com/cgi-bin/NumberToWordsInDutch.exe/soap/IDutch") > ok = IDutchservice_services.NumToStr0Request() > ok.Num=5 > print soap.

Re: trap setting attribute when the attribute is dict

2007-09-03 Thread John Machin
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 to catch the change in the dict (change > >>

Re: list index()

2007-09-03 Thread Ben Finney
Thorsten Kampe <[EMAIL PROTECTED]> writes: > * Ben Finney (Thu, 30 Aug 2007 18:02:15 +1000) > > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > > What's with using your brain instead of whining ? > > > > Now now, no need for snappiness. > > Actually there was. The OP's claim [...] ...is just

Re: Registering a python function in C

2007-09-03 Thread fernando
> Is Maya a different python build than what is contained at python.org? > If so, I suggest you get your C program to work with the latest python > build > from python.org. Then see if you can get it to work with the Maya > version. Ok, did that. If I write a normal C++ program and use the pytho

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

2007-09-03 Thread Sergio Correia
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 module where I do the getattr (that is, in spam.py). If I do any of th

Python411 Podcast: Python for Mobile Interfaces

2007-09-03 Thread UrsusMaximus
Python for Mobile Interfaces is a clarion call for Pythonistas to pioneer the future of alternative user interfaces for mobile phones, PDA's, and wearable computers, including voice recognition, gesture recognition, and wearable computing. www.awaretek.com -- http://mail.python.org/mailman/listi

ANN: lfm 2.0

2007-09-03 Thread Iñigo Serna
Hi out there, After a few years working silently I'm very pleased to announce here the so much awaited new version of 'lfm'. Last File Manager is a simple but powerful file manager for the UNIX console. It's written in Python, using curses module. Licensed under GNU Public License version 3. Som

Re: Let's Unite Against Jews and Mongrels!

2007-09-03 Thread Jarek Zgoda
Barry OGrady napisał(a): > What could anyone have against mongrels? You clearly don't know how abusive ROR can be. -- Jarek Zgoda http://jpa.berlios.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Let's Unite Against Jews and Mongrels!

2007-09-03 Thread Fit E. Cal
On Sep 3, 12:57 pm, [EMAIL PROTECTED] wrote: > On Sep 2, 9:18 am, "Richard B. Gilbert" <[EMAIL PROTECTED]> > wrote: > > > HEY! NOBODY BASHES THE TOOTH FAIRY! > -Shrug- I fucked her. mvm -- http://mail.python.org/mailman/listinfo/python-list

Re: trap setting attribute when the attribute is dict

2007-09-03 Thread Arnaud Delobelle
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 the propery being calculated > everytime the property

Colorado Python training in October

2007-09-03 Thread Mark Lutz
Python author and trainer Mark Lutz will be teaching another 3-day Python class at a conference center in Longmont, Colorado, on October 23-25, 2007. This is a public training session open to individual enrollments, and covers the same topics as the 3-day onsite sessions that Mark teaches, with ha

Python-URL! - weekly Python news and links (Sep 3)

2007-09-03 Thread Gabriel Genellina
QOTW: "If there were a protein that could only be folded by proving the Riemann Hypothesis, the gene that coded for it would quickly get weeded out of the gene pool." - Scott Aaaronson http://scottaaronson.com/blog/?p=266 "We read Knuth so you don't have to." - Tim Peters The first

Re: Python object <-> XML

2007-09-03 Thread Laurent Pointal
Samuel wrote: > Hi, > > 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 XM

Re: status of Programming by Contract (PEP 316)?

2007-09-03 Thread Bruno Desthuilliers
Russ a écrit : (snip) > Frankly, Mr. Holden, I'm getting a bit tired of the clannish behavior > here, where > "outsiders" like me are held to a higher standard than your "insider" > friends. I don't know who you are, nor do I care what you and your > little group think about me. If you took tim

Re: Python object <-> XML

2007-09-03 Thread Samuel
On Sep 3, 10:19 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > > 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? > > Yea, use ElementTree and you'd get a bunch of nested li

Re: TypeError: 'module object is not callable'

2007-09-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > > I have another little question before I finish today: > I am currently struggling to use a global variable in my static > functions. I'll explain further > > Within my main.py file I have > > class Main(object): > stepStore = StepStore() > > @stati

Re: Python object <-> XML

2007-09-03 Thread Jarek Zgoda
Samuel napisał(a): > 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?

Python object <-> XML

2007-09-03 Thread Samuel
Hi, 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? -Samuel -- http://mail.python.org/mailman/listi

Re: Let's Unite Against Jews and Mongrels!

2007-09-03 Thread devondejohn
On Sep 2, 9:18 am, "Richard B. Gilbert" <[EMAIL PROTECTED]> wrote: > Zentrader wrote: > > On Aug 28, 4:50 am, "Richard B. Gilbert" <[EMAIL PROTECTED]> > > wrote: > > >>>Unless, of course, someone has a working "Killbot". If anyone has such > > >>a thing, please kill that "MI5victim" moron as well!

Re: trap setting attribute when the attribute is dict

2007-09-03 Thread yosuke
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 to catch the change in the dict (change >> in some values, addition/deletion of key/value etc) to

Re: list index()

2007-09-03 Thread Thorsten Kampe
* Ben Finney (Thu, 30 Aug 2007 18:02:15 +1000) > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > What's with using your brain instead of whining ? > > Now now, no need for snappiness. Actually there was. The OP's claim | There are a million situations where you can have an item not be in | a

Re: trap setting attribute when the attribute is dict

2007-09-03 Thread Arnaud Delobelle
On Sep 3, 7:00 pm, <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a question which might be simple or need some work around. > > I want to do something like this. My class/instance has a dict as a > property. I want the instance to catch the change in the dict (change > in some values, additi

Re: list index()

2007-09-03 Thread Thorsten Kampe
* Terry Reedy (Fri, 31 Aug 2007 02:28:36 -0400) > "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | 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 exceptio

ShowMeDo.com Announces Winner of Most-Video-Plays of the Month

2007-09-03 Thread O.R.Senthil Kumaran
> ShowMeDo.com, a website offering over 361 instructional screencasts about > topics both Python and non-Python, has announced their first winner of the > month for the most-played video. And the winner is: > > "Learn Django: Create a Wiki in 20 minutes" > > by Siddharta Govindaraj, founder

Applying transformation matrix to 3D vertex coordinates

2007-09-03 Thread PhilC
''' 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 in the COB file looks like this:- T

Re: 400 Bad Request calling urllib2.urlopen()

2007-09-03 Thread O.R.Senthil Kumaran
> I have an url which redirects the client to another url. If I paste > the url into a browser, it works fine. If I open it via Any redirection is setup using either of the 301, 302, 303, 307 return codes of HTTP. Atleast, thats what standard determines. > File "C:\Python25\lib\urllib2.py", li

trap setting attribute when the attribute is dict

2007-09-03 Thread yosuke
Hello all, I have a question which might be simple or need some work around. I want to do something like this. My class/instance has a dict as a property. I want the instance to catch the change in the dict (change in some values, addition/deletion of key/value etc) to be recognized by the clas

Re: 400 Bad Request calling urllib2.urlopen()

2007-09-03 Thread Bjoern Schliessmann
Achim Domma wrote: > urllib2.HTTPError: HTTP Error 400: Bad Request > > I'm using Python 2.5.1 and Google did not help. Any hint on how to > fix or debug this problem? Use e. g. wireshark to look at the raw stream data and check if the request is malformed. Regards, Björn -- BOFH excuse #12

Re: So what exactly is a complex number?

2007-09-03 Thread Boris Borcic
Lamonte Harris wrote: > Like in math where you put letters that represent numbers for place > holders to try to find the answer type complex numbers? > Not quite. Relating them to (plane) trigonometry is much closer to the mark. Complex numbers are like a subclass of real numbers that elegantly

Re: SOAP : ZSI error

2007-09-03 Thread Boris Borcic
linuxprog wrote: > hello i need some help with ZSI module > i want to use the web service located here > www.ebob42.com/cgi-bin/NumberToWordsInDutch.exe/soap/IDutch > the wsdl file : > http://www.ebob42.com/cgi-bin/NumberToWordsInDutch.exe/wsdl/IDutch > that web service is very simple , the funct

Re: Problem with extremely small real number

2007-09-03 Thread Roberto Bonvallet
On 3 sep, 10:56, Andrea <[EMAIL PROTECTED]> wrote: > def binomial(n, k): > assert n>0 and isinstance(n, (int, long)) and isinstance(k, > (int,long)) Don't use assert to check whether the parameters have the right value. assert should be used to claim that a certain condition always hold i

Re: Does shuffle() produce uniform result ?

2007-09-03 Thread Paul Rubin
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 performance can drop spectaculary. No th

Re: TypeError: 'module object is not callable'

2007-09-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > >> >> The others spottet the error I missed. But I can offer something else: >> >> http://dirtsimple.org/2004/12/python-is-not-java.html >> >> It's a worthy read for someone coming from Java, needing time to adjust. >> >> Diez- Hide quoted text - >> >> - Show quoted te

Re: TypeError: 'module object is not callable'

2007-09-03 Thread Marc 'BlackJack' Rintsch
On Mon, 03 Sep 2007 16:13:28 +, christophertidy wrote: > Within my main.py file I have > > class Main(object): > stepStore = StepStore() > > @staticmethod > def createDepSteps(): > > stepStore.addStep([bol7, pre5]) > ... > > @staticmethod >

Re: TypeError: 'module object is not callable'

2007-09-03 Thread christophertidy
> > The others spottet the error I missed. But I can offer something else: > > http://dirtsimple.org/2004/12/python-is-not-java.html > > It's a worthy read for someone coming from Java, needing time to adjust. > > Diez- Hide quoted text - > > - Show quoted text - That deffinately was a useful rea

Re: How can I wait for all the threads I spawn for 5 minutes

2007-09-03 Thread Fabio Z Tessitore
> [cut] > But this code ends up waiting 5 minutes for **each** thread. that is > not what I want. I just want to wait for 5 minutes for all threads. how > can I do that? I've written a little code for you using threading. Hope it will help you: #! /usr/bin/env python # -*- coding: utf8 -*- impo

Re: Problem with extremely small real number

2007-09-03 Thread Arnaud Delobelle
On Sep 3, 3:56 pm, Andrea <[EMAIL PROTECTED]> wrote: > Hi, > I need to calculate this probability P!/{n \choose p}, varying both n > and p, n takes values in this range [512:1024] and p in [2:12]. > So i write this code in python: > > def factorial(n): > result=1 > if n==0: return 1

Re: Problem with extremely small real number

2007-09-03 Thread Fabio Z Tessitore
Il Mon, 03 Sep 2007 07:56:10 -0700, Andrea ha scritto: > [cut] > > I want to call factorial(2)//binomial(1024,2) for example, in this way > trivially I obtain 0 as probability, how can I obtain the probability > forcing this division to output extremely small real numbers int to float will h

Re: Problem with extremely small real number

2007-09-03 Thread Duncan Smith
Andrea wrote: > Hi, > I need to calculate this probability P!/{n \choose p}, varying both n > and p, n takes values in this range [512:1024] and p in [2:12]. > So i write this code in python: > > def factorial(n): > result=1 > if n==0: return 1 > for i in xrange(1, abs(n)+1): >

Re: Looking for Delaunay triangulation module...

2007-09-03 Thread Grant Edwards
On 2007-09-02, Robert Kern <[EMAIL PROTECTED]> wrote: >> Can anybody point me to a Delaunay triangulation module (for >> Win32)? I'm currently using http://flub.stuffwillmade.org/delny/ >> under Linux, but I have been unable to find a build for >> Windows. I don't have the tools (or skills) to b

How do I get triangles from a vtkPolyData object?

2007-09-03 Thread Grant Edwards
I posted this question to the vtk mailing list last week: I've been Googling and wandering through the class references most of the afternoon, but I can't figure out how to get the triangles out of the vtkPolyData that vtkDelaunay2D produces? I can get the vertex corredinates like this:

Re: Adding attributes stored in a list to a class dynamically.

2007-09-03 Thread Brian Munroe
On Sep 3, 6:34 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > The underscore versions are for customizing the lookup process, not for > dynamically looking up names. If your class needs to do something non- > standard when you write obj.name, you might need to write methods >

Problem with extremely small real number

2007-09-03 Thread Andrea
Hi, I need to calculate this probability P!/{n \choose p}, varying both n and p, n takes values in this range [512:1024] and p in [2:12]. So i write this code in python: def factorial(n): result=1 if n==0: return 1 for i in xrange(1, abs(n)+1): result = i*re

Re: Automation and scheduling of FrontPage publishing using Python

2007-09-03 Thread [EMAIL PROTECTED]
On Sep 2, 4:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Sep 1, 10:48 pm, Jerry <[EMAIL PROTECTED]> wrote: > > > andrew, > > > I would try looking into Windows automation with > > Python.http://www.google.com/search?q=windows+automation+pythonshouldget > > you started. The winGuiAut

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers

2007-09-03 Thread Bruno Desthuilliers
Martin v. Löwis a écrit : >>> (2) it is a interpretation language >> Not quite. It's compiled to byte-code - just like Java (would you call >> Java an 'interpreted language' ?) > > Python is not implemented like Java. In Java (at least in HotSpot), > the byte code is further compiled to machine co

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers

2007-09-03 Thread Paul Boddie
On 3 Sep, 15:39, [EMAIL PROTECTED] wrote: > Thanks for all the answers to my question. I think what I need to take > away from this is that xrange is an object Indeed, but using xrange can be faster than converting your "for" loops to "while" loops plus a counter; I converted your code to use the

Re: How can I wait for all the threads I spawn for 5 minutes

2007-09-03 Thread Antoon Pardon
On 2007-08-31, herman <[EMAIL PROTECTED]> wrote: > Hi, > > In my python program, I would to like to spwan 5 threads, for the them > for 5 minutes maximum and the continue. Here is my script: > > threads = [] > > for j in range(5): > t = MyThread() >

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers

2007-09-03 Thread jwrweatherley
Thanks for all the answers to my question. I think what I need to take away from this is that xrange is an object - I thought it was just some loop construct, and that maths is slow in python - so avoid pathological looping.I remember the first time I tried Objective-C on OS X I used the NSNumber c

Re: Adding attributes stored in a list to a class dynamically.

2007-09-03 Thread Steven D'Aprano
On Mon, 03 Sep 2007 04:37:54 +, Brian Munroe wrote: > On Sep 2, 3:33 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > > >> In a nutshell, like all double-underscore methods, __setattr__ are for >> overriding behaviour in your own classes. With very few exceptions, you >>

Re: Soemthing wrong w/ urllib module or something.

2007-09-03 Thread Tim Golden
[Tim Golden] >> To do the obvious, can you open a socket connection >> to the domain you're using? >> >> >> from socket import socket >> socket ().connect (("DOMAINHERE", 80)) >> >> >> >> or does it give you the same error? [Lamonte Harris] > Yeah I basically got the same error. > > T

400 Bad Request calling urllib2.urlopen()

2007-09-03 Thread Achim Domma
Hi, I have an url which redirects the client to another url. If I paste the url into a browser, it works fine. If I open it via urllib2.urlopen() I get the following error: Traceback (most recent call last): File "...\crawlRawDocuments.py", line 16, in body = urlopen(url).read() File "C:

Re: How does super() work?

2007-09-03 Thread Gerardo Herzig
Lamonte Harris wrote: >I've searched Google, and other search engines to try to find out how >super() works. Can someone explain in short detail how super() works? I >may and may not need to know this information, but it is good to know. > > > There is at least one explanation in the python.or

Re: TypeError: 'module object is not callable'

2007-09-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Thank you for your help that seems to have done the trick. > You are correct Diez B. Roggisch that I come from a java background! > > I have a new tiny problem I can't understand either. > Withing Step.py I have the following method > > def isCompleted(self): > "C

Re: So what exactly is a complex number?

2007-09-03 Thread richyjsm
On Sep 2, 6:13 am, Grzegorz S odkowicz <[EMAIL PROTECTED]> wrote: > In fact, a proper vector in physics has 4 features: point of > application, magnitude, direction and sense. so whats the "point of application" of the sum of two vectors? Do tell. -- http://mail.python.org/mailman/listinfo/py

Re: So what exactly is a complex number?

2007-09-03 Thread Francesco Guerrieri
On 9/3/07, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > Grzegorz Słodkowicz wrote: > > In fact, a proper vector in physics has 4 features: point of > > application, magnitude, direction and sense. > > > OK, help me out here: What 'direction' does |Ψ> (a state-vector in > quantum mechanics)

Re: advice about `correct' use of decorator

2007-09-03 Thread Gregor Horvath
Gerardo Herzig schrieb: > > @is_logued_in > def change_pass(): >bla >bla > > And so on for all the other functions who needs that the user is still > loged in. > > where obviosly the is_logued_in() function will determine if the dude is > still loged in, and THEN execute change_pass().

Urgently Required SAP CO-COPA Functional Lead

2007-09-03 Thread HR Head
We urgently require following skill set for singapore client SAP CO-COPA Functional Lead: Person with a strong Costing background. Should have hands on SAP "COPA" experience Minimum two implementations in Controling based Profitability Analysis (COPA) and Product Costing (COPC) in the SAP COPA

Re: TypeError: 'module object is not callable'

2007-09-03 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > Thank you for your help that seems to have done the trick. > You are correct Diez B. Roggisch that I come from a java background! > > I have a new tiny problem I can't understand either. > Withing Step.py I have the following method > > def isCompleted(self): > "Che

  1   2   >