Re: sqlite3 question

2007-04-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > En Thu, 12 Apr 2007 08:43:49 -0300, Marc 'BlackJack' Rintsch > <[EMAIL PROTECTED]> escribió: > >> In <[EMAIL PROTECTED]>, Jorgen Bodde >> wrote: >> >> r = c.execute('select * from song where id = 1') >> for s in r: >>> ... print

Antigen Notification: Antigen found a message matching a filter

2007-04-15 Thread Antigen_VITORIA
Microsoft Antigen for Exchange found a message matching a filter. The message is currently Detected. Message: "Python_list Digest_ Vol 43_ Issue 249" Filter name: "KEYWORD= spam: graduate" Sent from: "[EMAIL PROTECTED]" Folder: "SMTP Messages\Inbound And Outbound" Location: "ITURAN/First Administr

Re: How to initialize a table of months.

2007-04-15 Thread Michel Claveau
Hi (bis) A class way : class cmon(object): Jan=1 Feb=2 Fev=2 Mar=3 Apr=4 Avr=4 May=5 Mai=5 Jun=6 Jui=6 Juin=6 Jul=7 Juil=7 Aug=8 Aou=8 Sep=9 Oct=10 Nov=11 Dec=12 print cmon.Mar print cmon.Sep print cmon.Dec -- @-salutations Miche

Re: How to initialize a table of months.

2007-04-15 Thread Michel Claveau
Hi! Not best, but another lisibility : mons=dict(Jan=1, Feb=2, Fev=2, Mar=3, Apr=4, Avr=4, May=5, Mai=5, Jun=6, Jui=6, Jul=7, Aug=8, Aou=8, Sep=9, Oct=10, Nov=11, Dec=12) def mon2int(m): return mons[m] def mond2int(**m): return mons[m.keys()[0]] print mons['Mar'] print mon2int('May')

Queue enhancement suggestion

2007-04-15 Thread Paul Rubin
I'd like to suggest adding a new operation Queue.finish() This puts a special sentinel object on the queue. The sentinel travels through the queue like any other object, however, when q.get() encounters the sentinel, it raises StopIteration instead of returning the sentinel. It does not remo

Re: How to initialize a table of months.

2007-04-15 Thread [EMAIL PROTECTED]
On Apr 16, 1:14 pm, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > On Apr 15, 10:33 pm, "7stud" <[EMAIL PROTECTED]> wrote: > > > > > On Apr 15, 9:30 pm, "7stud" <[EMAIL PROTECTED]> wrote: > > > > On Apr 15, 7:30 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > > > Arrgh. > > > import calendar > > > mo

Re: How to initialize a table of months.

2007-04-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Steven W. Orr wrote: > I want to call datetime.datetim() whose arg2 is a number between 1-12 so I > have to convert the month to an integer. > I wrote this, but I have a sneaky suspicion there's a better way to do it. > > mons = {'Jan':1, 'Feb':2, 'Mar':3, 'Apr':4, 'May':

Re: How to initialize a table of months.

2007-04-15 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I'm reading a logfile with a timestamp at the begging of each line, e.g., > > Mar 29 08:29:00 > > I want to call datetime.datetim() whose arg2 is a number between 1-12 so I > have to convert the month to an integer. >

Re: working of round()

2007-04-15 Thread subscriber123
On Apr 15, 8:06 pm, [EMAIL PROTECTED] wrote: > Does round() always perfectly return the output expected or are there > some artifacts which don't allow perfect functionality > > Using python 2.5: > > >>> round(12.234, 2) > 12.23 > >>> round(12.234, 3) > 12.234 > >>> round(12.234, 1) > 12.19

Re: How to initialize a table of months.

2007-04-15 Thread Paul McGuire
On Apr 15, 10:33 pm, "7stud" <[EMAIL PROTECTED]> wrote: > On Apr 15, 9:30 pm, "7stud" <[EMAIL PROTECTED]> wrote: > > > On Apr 15, 7:30 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > > Arrgh. > > import calendar > > months = calendar.month_abbr > #returns an array with the 0 element empty > #so th

Re: Getting started with python

2007-04-15 Thread [EMAIL PROTECTED]
The Python Papers (http://pythonpapers.org) is another resource for Python developers, especially those interested in keeping tabs on the various projects and articles out there in the community. Cheers, -T (Editor-In-Chief, The Python Papers) -- http://mail.python.org/mailman/listinfo/python-li

Re: pyparsing Catch-22

2007-04-15 Thread Paul McGuire
Please take a look at the new page added to the pyparsing wiki. -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting started with python

2007-04-15 Thread [EMAIL PROTECTED]
On Apr 15, 8:05 pm, [EMAIL PROTECTED] wrote: > On Apr 15, 9:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > On Apr 14, 7:46 pm, "Eric" <[EMAIL PROTECTED]> wrote: > > > > Hello, after reading some of the book Programming Python it seems that > > > python is something I would like

Re: pyparsing Catch-22

2007-04-15 Thread Paul McGuire
On Apr 15, 8:26 pm, "7stud" <[EMAIL PROTECTED]> wrote: > To the developer: > > 1) I went to the pyparsing wiki to download the pyparsing module and > try it > 2) At the wiki, there was no index entry in the table of contents for > Downloads. After searching around a bit, I finally discovered a t

Re: Qt4 in ubuntu

2007-04-15 Thread Parthan SR
On 15 Apr 2007 13:24:22 -0700, Marcpp <[EMAIL PROTECTED]> wrote: Is possible install Qt4 pyqt4 under kubuntu? Few times ago i tried to run pyqt in ubuntu (gnome) but i can't do it. Installation as in [1] Installing using the apt-get/synaptic/adept/aptitude which is present in Ubuntu/Kubuntu o

Re: Getting started with python

2007-04-15 Thread James Stroud
Steve Holden wrote: > You'd be worth more if you'd used elif and omitted the continue > statements, but for a first solution it's acceptable. Depends on what you are after. py> s = """ ... for i in xrange(1,101): ... if not i % 15: ... continue ... if not i % 5: ... continue ... if

Re: how to strip the domain name in python?

2007-04-15 Thread Michael Bentley
On Apr 15, 2007, at 7:57 PM, Michael Bentley wrote: > if net_location[0].lower() == 'www': > net_location = net_location[1:] It is not guaranteed that the host name will be 'www' though, is it? If you *really* want to strip the host portion of a domain name, I suppose you could m

Re: working of round()

2007-04-15 Thread Robert Kern
Steven Bethard wrote: > I'm not sure why you would have expected 2.62 for the latter when:: > > >>> 5.25 / 2 > 2.625 Round-to-nearest-even is a valid, and oft-recommended rounding mode for numbers exactly halfway between two round numbers. -- Robert Kern "I have come to believe that

Re: Getting started with python

2007-04-15 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > 1. This doesn't act according to the specification if you add, for > example, (2, 'Zonk'). Now 30 gives 'ZonkFizzBuzz' and not 'FizzBuzz' > according to the specification. Correct, the original specification only had 3 and 5. I gave a longer example to i

Re: Getting started with python

2007-04-15 Thread James Stroud
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: >> You'd be worth more if you'd used elif and omitted the continue >> statements, but for a first solution it's acceptable. >> >> For better readability I'd have used >> if i % 5 == 0 > > I think I'd be more concerned about getting

Re: How to initialize a table of months.

2007-04-15 Thread 7stud
On Apr 15, 9:30 pm, "7stud" <[EMAIL PROTECTED]> wrote: > On Apr 15, 7:30 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: Arrgh. import calendar months = calendar.month_abbr #returns an array with the 0 element empty #so the month names line up with the indexes 1-12 d = {} for i in range(1, 13):

Re: How to initialize a table of months.

2007-04-15 Thread 7stud
On Apr 15, 7:30 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I'm reading a logfile with a timestamp at the begging of each line, e.g., > > Mar 29 08:29:00 > > I want to call datetime.datetim() whose arg2 is a number between 1-12 so I > have to convert the month to an integer. > I wrote this, bu

Re: pyparsing Catch-22

2007-04-15 Thread 7stud
On Apr 15, 9:16 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > 7stud <[EMAIL PROTECTED]> wrote: > > 1) Even though the download at sourceforge said the file name was: > > > pyparsing-1.4.6.tar.gz > > > it was downloaded to my Desktop as: > > > pyparsing-1.4.6.tar > > > Did os x 10.4.7 automatically

Re: pyparsing Catch-22

2007-04-15 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: > 1) Even though the download at sourceforge said the file name was: > > pyparsing-1.4.6.tar.gz > > it was downloaded to my Desktop as: > > pyparsing-1.4.6.tar > > Did os x 10.4.7 automatically unzip it for me? .gz means the file was > compressed with gzip, bu

Re: Calling private base methods

2007-04-15 Thread Alex Martelli
Isaac Rodriguez <[EMAIL PROTECTED]> wrote: > > The fact that I had > > to resort to this trick is a big indication of course that genuinely > > private members (as opposed to a 'keep off' naming convention) are a bad > > idea in general. > > The fact that you had to resort to this trick is a big

Re: pyparsing Catch-22

2007-04-15 Thread 7stud
On Apr 15, 7:41 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > For as hard as you push pyparsing on this forum, I would think you > > would make it easier to download and install your module. In my > > opinion, the wiki should provide detailed installation instructions > > for a

Re: Any Pythonistas in Mexico?

2007-04-15 Thread Alex Martelli
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 12 Apr 2007 10:56:32 -0300, Marcpp <[EMAIL PROTECTED]> escribió: > > > On 12 abr, 09:41, Hugo González Monteverde <[EMAIL PROTECTED]> wrote: > >> Leí este mail viejísimo en una lista. Yo uso Python y también quería > >> saber quién pythoneaba

Re: combination function in python

2007-04-15 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > You could take it up with the gmpy author and > > induce him to get gmpy included in the standard distro if you are so > > inclined. > > Alex Martelli knows more about that subject than I and > it would be pointless for me to bug him about it. gmp

Re: How to initialize a table of months.

2007-04-15 Thread John Zenger
On Apr 15, 9:30 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I'm reading a logfile with a timestamp at the begging of each line, e.g., > > Mar 29 08:29:00 > > I want to call datetime.datetim() whose arg2 is a number between 1-12 so I > have to convert the month to an integer. > I wrote this, bu

Re: pyparsing Catch-22

2007-04-15 Thread Steven Bethard
7stud wrote: > For as hard as you push pyparsing on this forum, I would think you > would make it easier to download and install your module. In my > opinion, the wiki should provide detailed installation instructions > for all supported os's, and the sourceforge downloading process is too > comp

Re: is laziness a programer's virtue?

2007-04-15 Thread D Herring
Blatherskite! http://innovators.vassar.edu/innovator.html?id=8 http://www.itweek.co.uk/itweek/comment/2160655/laziness-mother-invention -- http://mail.python.org/mailman/listinfo/python-list

How to initialize a table of months.

2007-04-15 Thread Steven W. Orr
I'm reading a logfile with a timestamp at the begging of each line, e.g., Mar 29 08:29:00 I want to call datetime.datetim() whose arg2 is a number between 1-12 so I have to convert the month to an integer. I wrote this, but I have a sneaky suspicion there's a better way to do it. mons = {'Jan':

pyparsing Catch-22

2007-04-15 Thread 7stud
To the developer: 1) I went to the pyparsing wiki to download the pyparsing module and try it 2) At the wiki, there was no index entry in the table of contents for Downloads. After searching around a bit, I finally discovered a tiny link buried in some text at the top of the home page. 3) Link

Re: how to check the 'content/type' using urlopen

2007-04-15 Thread Michael Bentley
On Apr 15, 2007, at 6:25 PM, John wrote: > > i have the following code to open a URL address, but can you please > tell me how can I check the content type of the url response? > > Thank you. > > try: > req = Request(url, txdata, txheaders) > handle = urlopen(req) > except I

Re: Getting started with python

2007-04-15 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > You'd be worth more if you'd used elif and omitted the continue > statements, but for a first solution it's acceptable. > > For better readability I'd have used > if i % 5 == 0 I think I'd be more concerned about getting rid of the i%15 test. What i

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Dan Bishop
On Apr 15, 6:06 pm, "Beliavsky" <[EMAIL PROTECTED]> wrote: > On Apr 14, 10:12 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > > > > > So the running count is: > > Ayes to the left: VB compatibility. > > Nays to the right: QuadIO, Perl, Dijkstra paper. > > > The nays have it! > > One-based indexing

Re: Python editor/IDE on Linux?

2007-04-15 Thread Daniel Gee
didn't know that one. Perhaps I'll look into Gvim (I still like to cut and paste with the mouse, even if I left that off my list). -- http://mail.python.org/mailman/listinfo/python-list

Re: Portably generating infinity and NaN

2007-04-15 Thread skip
Michael> Will float("NaN") work on these systems? (I don't know.) I Michael> guess it probably works on some system that isn't IEEE 754. My thought was that in configure you could test if strtof("NaN") and strtof("Inf") worked. If not, calculate the necessary bit patterns at that point a

Re: Python and XML?

2007-04-15 Thread Leonard J. Reder
Stefan Behnel wrote: > Leonard J. Reder wrote: >> What I as really after though was other possible solutions >> like JAX in the Java world or Gnosis in the Python world. >> >> Something that can take a Relax NG Schema and compile >> it into a bunch of parser/generator objects for handling >> an XML

Re: Getting started with python

2007-04-15 Thread chengzhiannahuang
On Apr 15, 9:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Apr 14, 7:46 pm, "Eric" <[EMAIL PROTECTED]> wrote: > > > Hello, after reading some of the book Programming Python it seems that > > python is something I would like to delve deeper into. The only thing > > is, I have no idea wh

Re: yield, curry, mix-in, new.function, global, closure, .... what will work?

2007-04-15 Thread Paul Rubin
[EMAIL PROTECTED] writes: > On Apr 15, 8:07 pm, Paul Rubin wrote: > > That is total madness. Just use a normal object or dictionary with a lock. > > Please, can you elaborate further, I'm not sure if I understood. > Should I lock global variables i, j during the executi

Re: Python and JMS?

2007-04-15 Thread Leonard J. Reder
Thanks Jarek, Yes indeed, we are using ActiveMQ and I did see the StomPy python package. But I also saw that it said stomp was done as a student project that ended. Maybe I will try hjb for now - all I need to do is listen for messages on a certain topic. Maybe some of our internal people will

Re: how to strip the domain name in python?

2007-04-15 Thread Michael Bentley
On Apr 15, 2007, at 4:24 PM, [EMAIL PROTECTED] wrote: > On Apr 15, 11:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, >> Marko.Cain.23 >> wrote: >> >> >> >>> On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: On Apr 14, 12:02 am, Michael Bentley <[EMAIL PRO

Re: combination function in python

2007-04-15 Thread [EMAIL PROTECTED]
On Apr 15, 4:16?pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> We're getting closer and closer to something I already posted a few > >> times here. This implementation was unfortunate because I consistently > >> used an uncommon name for it so people couldn't easily

Re: yield, curry, mix-in, new.function, global, closure, .... what will work?

2007-04-15 Thread ecir . hana
On Apr 15, 8:07 pm, Paul Rubin wrote: > That is total madness. Just use a normal object or dictionary with a lock. Please, can you elaborate further, I'm not sure if I understood. Should I lock global variables i, j during the execution of run()? In that case I have to

Re: working of round()

2007-04-15 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Does round() always perfectly return the output expected or are there > some artifacts which don't allow perfect functionality > > Using python 2.5: round(12.234, 2) > 12.23 round(12.234, 3) > 12.234 round(12.234, 1) > 12.199 > > but was expec

Re: Getting started with python

2007-04-15 Thread Steve Holden
James Stroud wrote: > Gabriel Genellina wrote: >> En Sun, 15 Apr 2007 10:46:54 -0300, Army1987 <[EMAIL PROTECTED]> escribió: >> >>> "Paddy" <[EMAIL PROTECTED]> ha scritto nel messaggio >>> news:[EMAIL PROTECTED] >>> On a different tack, from: http://tickletux.wordpress.com/2007/01/24/usin

Re: how to strip the domain name in python?

2007-04-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 15, 11:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, Marko.Cain.23 >> wrote: >> >> >> >>> On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 13

Re: Portably generating infinity and NaN

2007-04-15 Thread Steve Holden
Paul Rubin wrote: > [EMAIL PROTECTED] writes: >> But PEP 754 will only work for architectures supporting IEEE 754. I realize >> that's the vast majority of systems, but aren't there still a few Crays and >> VMS machines out there? (Do those architectures support NaN and Inf?) > > I wouldn't worr

Re: working of round()

2007-04-15 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Does round() always perfectly return the output expected or are there > some artifacts which don't allow perfect functionality > > Using python 2.5: round(12.234, 2) > 12.23 round(12.234, 3) > 12.234 round(12.234, 1) > 12.199 > > but was expec

Re: Portably generating infinity and NaN

2007-04-15 Thread Robert Kern
Paul Rubin wrote: > I doubt any Crays are still running, or at least > running any numerical code written in Python. You are wrong. > Same for VMS. Also wrong. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad at

working of round()

2007-04-15 Thread Krishna . K . 1900
Does round() always perfectly return the output expected or are there some artifacts which don't allow perfect functionality Using python 2.5: >>> round(12.234, 2) 12.23 >>> round(12.234, 3) 12.234 >>> round(12.234, 1) 12.199 >>> but was expecting 12.2 Also, for round(x,n), can't 'x'

Re: is laziness a programer's virtue?

2007-04-15 Thread Cor Gest
Some entity, AKA [EMAIL PROTECTED], wrote this mindboggling stuff: (selectively-snipped-or-not-p) > Of course, for functional languages, 'lazy' means something rather > different... > lazy means: just get a post-grad to do the grunt-work for free. Cor -- The biggest problem LISP has is that

Re: Getting started with python

2007-04-15 Thread James Stroud
Gabriel Genellina wrote: > En Sun, 15 Apr 2007 10:46:54 -0300, Army1987 <[EMAIL PROTECTED]> escribió: > >> "Paddy" <[EMAIL PROTECTED]> ha scritto nel messaggio >> news:[EMAIL PROTECTED] >> >>> On a different tack, from: >>> http://tickletux.wordpress.com/2007/01/24/using-fizzbuzz-to-find-developer

how to check the 'content/type' using urlopen

2007-04-15 Thread John
i have the following code to open a URL address, but can you please tell me how can I check the content type of the url response? Thank you. try: req = Request(url, txdata, txheaders) handle = urlopen(req) except IOError, e: print e print 'Failed to open %s'

Re: Portably generating infinity and NaN

2007-04-15 Thread Paul Rubin
[EMAIL PROTECTED] writes: > But PEP 754 will only work for architectures supporting IEEE 754. I realize > that's the vast majority of systems, but aren't there still a few Crays and > VMS machines out there? (Do those architectures support NaN and Inf?) I wouldn't worry about it. There are Pyth

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Beliavsky
On Apr 14, 10:12 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > So the running count is: > Ayes to the left: VB compatibility. > Nays to the right: QuadIO, Perl, Dijkstra paper. > > The nays have it! One-based indexing would also Python more compatible with Fortran, Matlab/Octave/Scilab, and S

Re: Making a tree out of a 2 column list

2007-04-15 Thread Sebastian Bassi
On 15 Apr 2007 15:44:47 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > But errors and bugs do happen, inside data too; so often it's better > to be on safe side if the safe code is fast enough. Yes, I agree since I've seen lot of errors in data. But this data comes from a taxonomy tree made

Re: Portably generating infinity and NaN

2007-04-15 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > Michael> If you're going to change CPython to do this, I think adopting > Michael> PEP 754, and using the fpconst module would be better than > Michael> changing how float() works when called on string literals. > > But PEP 754 will only work for architectur

Re: is laziness a programer's virtue?

2007-04-15 Thread dbenson
Of course, for functional languages, 'lazy' means something rather different... -- http://mail.python.org/mailman/listinfo/python-list

Re: optparse -- anyway to find if the user entered an option?

2007-04-15 Thread Michael Hoffman
James Stroud wrote: > Karthik Gurusamy wrote: >> Hi, >> >> I see that I can provide a default value for an option. But I couldn't >> find out any way if the user really entered the option or the option >> took that value because of default. A simple check for value with >> default may not always wo

Re: Making a tree out of a 2 column list

2007-04-15 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > I guess this should make the program enter into a endless loop. But > > the data won't have such a redundancy, because it was taken from a > > philogenetic tree. > > But errors and bugs do happen, inside data too; so often it's better > to be on safe side if the safe

Re: Making a tree out of a 2 column list

2007-04-15 Thread bearophileHUGS
Sebastian Bassi: > I guess this should make the program enter into a endless loop. But > the data won't have such a redundancy, because it was taken from a > philogenetic tree. But errors and bugs do happen, inside data too; so often it's better to be on safe side if the safe code is fast enough.

Re: Standardizing XML

2007-04-15 Thread ZeeGeek
On Apr 15, 1:13 pm, ZeD <[EMAIL PROTECTED]> wrote: > ZeeGeek wrote: > > in the code returned by Live Space, they use instead of so > > that Blogger will complain that this tag is not valid because it > > doesn't have a closing tag. Another example is that the contents of a > > lot of the tag att

Re: Standardizing XML

2007-04-15 Thread ZeeGeek
On Apr 15, 1:13 pm, Jonathan Ballet <[EMAIL PROTECTED]> wrote: > Le 15 Apr 2007 11:02:20 -0700, > "ZeeGeek" <[EMAIL PROTECTED]> a écrit : > > > Thanks for correcting me. I worded it inproperly. For example, in > > the code returned by Live Space, they use instead of so > > that Blogger will com

Re: combination function in python

2007-04-15 Thread Steven D'Aprano
On Sun, 15 Apr 2007 13:58:38 -0700, Mark Dickinson wrote: > ... for large n and k it's difficult to imagine any real-world > applications that wouldn't be better served by using the lngamma > function instead. That is, the natural log of n choose k can be > computed much more quickly as > > lnga

Re: Any Pythonistas in Mexico?

2007-04-15 Thread Gabriel Genellina
En Thu, 12 Apr 2007 10:56:32 -0300, Marcpp <[EMAIL PROTECTED]> escribió: > On 12 abr, 09:41, Hugo González Monteverde <[EMAIL PROTECTED]> wrote: >> Leí este mail viejísimo en una lista. Yo uso Python y también quería >> saber quién pythoneaba en México. Todavía estás por ahí? > > Yo vivo en España

Re: sqlite3 question

2007-04-15 Thread Gabriel Genellina
En Thu, 12 Apr 2007 08:43:49 -0300, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> escribió: > In <[EMAIL PROTECTED]>, Jorgen Bodde > wrote: > > r = c.execute('select * from song where id = 1') > for s in r: >> ... print s >> ... >> (1, u'Spikedrivers Blues', u'Mississippi John Hurt')

Re: how to strip the domain name in python?

2007-04-15 Thread Marko . Cain . 23
On Apr 15, 11:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Marko.Cain.23 > wrote: > > > > > On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: > >> On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> > >> wrote: > > >> > On Apr 13, 2007, at 11:49 PM, [EMAIL P

Re: is laziness a programer's virtue?

2007-04-15 Thread James Stroud
Xah Lee wrote: > Laziness, Perl, and Larry Wall > > Xah Lee, 20021124 > > In the unix community there's quite a large confusion and wishful > thinking about the word laziness. In this post, i'd like to make some > clarifications. > > American Heritage Dictionary third edition defines laziness as

Re: combination function in python

2007-04-15 Thread Anton Vredegoor
[EMAIL PROTECTED] wrote: >> We're getting closer and closer to something I already posted a few >> times here. This implementation was unfortunate because I consistently >> used an uncommon name for it so people couldn't easily find it > > But then, who's looking for it? The OP was trying to fin

Re: Calling private base methods

2007-04-15 Thread Diez B. Roggisch
Paul Rubin schrieb: > Duncan Booth <[EMAIL PROTECTED]> writes: >> The problem is that when people design interfaces they don't (and >> cannot) know all the situations in which the code is going to be used in >> the future. Clearly separating the published interface from the >> implementation det

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Beliavsky
On Apr 14, 10:55 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > The FORTRAN family had started as 1-based (F95, and Ada, now allow > for each array to have its own "base" => x : array (-10..10) of float). Fortran has allowed a user-specified base since at least the 1977 standard --

Re: reading from sys.stdin

2007-04-15 Thread Diez B. Roggisch
>> Steve Holden +44 150 684 7255 +1 800 494 3119 >> Holden Web LLC/Ltd http://www.holdenweb.com >> Skype: holdenwebhttp://del.icio.us/steve.holden >> Recent Ramblings http://holdenweb.blogspot.com > > I just typed in 700 lines of text, and the iteration hasn't begun > yet.

Re: split and regexp on textfile

2007-04-15 Thread Gabriel Genellina
En Fri, 13 Apr 2007 07:08:05 -0300, Flyzone <[EMAIL PROTECTED]> escribió: > A little question: the pat.split can split without delete the date? No, but instead of reading the whole file and splitting on dates, you could iterate over the file and detect block endings: def split_on_dates(ftopa

Re: combination function in python

2007-04-15 Thread Mark Dickinson
On Apr 15, 3:33 pm, [EMAIL PROTECTED] wrote: > With few tests, it seems this is faster than the version by Jussi only > with quite big n,k. > True---and for large n and k it's difficult to imagine any real-world applications that wouldn't be better served by using the lngamma function instead. Th

Re: Qt4 in ubuntu

2007-04-15 Thread Diez B. Roggisch
Marcpp schrieb: > Is possible install Qt4 pyqt4 under kubuntu? > Few times ago i tried to run pyqt in ubuntu (gnome) but i can't > do it. It's certainly possible. On ubuntu as well as on kubuntu. You can install all KDE and Qt stuff on ubuntu as well. But unless you are more specific what your a

Re: is laziness a programer's virtue?

2007-04-15 Thread Claudio Grondi
Xah Lee wrote: > [SOME FURTHER TROLLING DISTRIBUTED TO MULTIPLE NEWSGROUPS] For those who are relatively new here in comp.lang.python and not aware of the troll: It seems, that Xah still haven't learned from the impact of past abuse reports on his Internet access and tries again to pollute Usen

Re: reading from sys.stdin

2007-04-15 Thread Gabriel Genellina
En Sun, 15 Apr 2007 16:51:12 -0300, 7stud <[EMAIL PROTECTED]> escribió: > I just typed in 700 lines of text, and the iteration hasn't begun > yet. Should I keep going? How much text each line? Python uses an 8K buffer. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-l

Re: combination function in python

2007-04-15 Thread [EMAIL PROTECTED]
On Apr 15, 11:34�am, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > Jussi Piitulainen wrote: > >> There's probably even a really clever way to avoid that final > >> division, but I suspect that would cost more in time and memory than > >> it would save. > > We're getting closer and closer to somethin

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Paddy
On Apr 15, 6:42 pm, "Javier Bezos" <[EMAIL PROTECTED]> wrote: > > Here is a document giving good reasons for indexing to start at > > zero, as in Python. > >http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html > > The author has done a bit: > >http://en.wikipedia.org/wiki/Dijkstra

Qt4 in ubuntu

2007-04-15 Thread Marcpp
Is possible install Qt4 pyqt4 under kubuntu? Few times ago i tried to run pyqt in ubuntu (gnome) but i can't do it. -- http://mail.python.org/mailman/listinfo/python-list

Re: is laziness a programer's virtue?

2007-04-15 Thread Jim Ford
Xah Lee wrote: > Laziness, Perl, and Larry Wall > > Xah Lee, 20021124 > > In the unix community there's quite a large confusion and wishful > thinking about the word laziness. In this post, i'd like to make some > clarifications. Years ago I used to work with someone who used to say 'I'm a lazy

Re: Making a tree out of a 2 column list

2007-04-15 Thread Sebastian Bassi
On 4/15/07, Peter Otten <[EMAIL PROTECTED]> wrote: > Depending on your input data you may need to add some cycle detection. > For example, try it with > tree_path(1, {1:[2], 2:[1]}, []) I guess this should make the program enter into a endless loop. But the data won't have such a redundancy, becau

Re: is laziness a programer's virtue?

2007-04-15 Thread Xah Lee
Dear Ken, I want to thank you for your spirit in supporting and leading the lisp community, in spreading lisp the language both in what you have done technically as well as evangelization, as well as the love and knowledge attitude towards newsgroup communities in general, in part thru your numero

Re: reading from sys.stdin

2007-04-15 Thread 7stud
On Apr 15, 10:59 am, Steve Holden <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > On Apr 14, 7:43 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> 7stud wrote: > >>> On Apr 13, 6:20 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > >> [...] > > >>> But if you hit return on a blank line, there is no er

Re: Python Feature Request: (?) Group all file-directory-related stdlib functions in one place

2007-04-15 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Currently file-directory-related functionality in the Python standard > > library is scattered among various modules such as shutil, os, > > dircache etc. So I request that the functions be gathered and > > consolida

Re: is laziness a programer's virtue?

2007-04-15 Thread John Thingstad
On Sun, 15 Apr 2007 18:25:19 +0200, Xah Lee <[EMAIL PROTECTED]> wrote: > Laziness, Perl, and Larry Wall > > Xah Lee, 20021124 > > In the unix community there's quite a large confusion and wishful > thinking about the word laziness. In this post, i'd like to make some > clarifications. > > American

Re: combination function in python

2007-04-15 Thread bearophileHUGS
Mark Dickinson: > def choose(n, k): > ntok = 1 > for t in xrange(min(k, n-k)): > ntok = ntok*(n-t)//(t+1) > return ntok With few tests, it seems this is faster than the version by Jussi only with quite big n,k. (Another test to be added, is the assert n>0 of my original versio

Re: Calling private base methods

2007-04-15 Thread Paul Rubin
Duncan Booth <[EMAIL PROTECTED]> writes: > The problem is that when people design interfaces they don't (and > cannot) know all the situations in which the code is going to be used in > the future. Clearly separating the published interface from the > implementation details is a good thing, but

Re: is laziness a programer's virtue?

2007-04-15 Thread Kay Schluehr
On Apr 15, 6:25 pm, "Xah Lee" <[EMAIL PROTECTED]> wrote: > Laziness, Perl, and Larry Wall > > Xah Lee, 20021124 > > In the unix community there's quite a large confusion and wishful > thinking about the word laziness. In this post, i'd like to make some > clarifications. > > American Heritage Dicti

Re: is laziness a programer's virtue?

2007-04-15 Thread Daniel Gee
You fail to understand the difference between passive laziness and active laziness. Passive laziness is what most people have. It's active laziness that is the virtue. It's the desire to go out and / make sure/ that you can be lazy in the future by spending just a little time writing a script now.

Re: tuples, index method, Python's design

2007-04-15 Thread Paul Rubin
Roel Schroeven <[EMAIL PROTECTED]> writes: > In this case s[0] is not the full Unicode scalar, but instead just the > first part of the surrogate pair consisting of 0x1D40 (in s[0]) and > 0x (in s[1]). Agggh. After much head scratching I think I now understand what you are saying. This a

Re: Getting started with python

2007-04-15 Thread Gabriel Genellina
En Sun, 15 Apr 2007 10:46:54 -0300, Army1987 <[EMAIL PROTECTED]> escribió: > "Paddy" <[EMAIL PROTECTED]> ha scritto nel messaggio > news:[EMAIL PROTECTED] > >> On a different tack, from: >> http://tickletux.wordpress.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/ >> It seems you

Re: combination function in python

2007-04-15 Thread Jussi Piitulainen
Mark Dickinson writes: > Jussi Piitulainen wrote: > > > def choose(n, k): > >if 0 <= k <= n: > >ntok = 1 > >ktok = 1 > >for t in xrange(1, min(k, n - k) + 1): > > ntok *= n > > ktok *= t > > n -= 1 > >return ntok // ktok > >else:

Re: Method calls and stack consumption

2007-04-15 Thread Martin Manns
On Sun, 15 Apr 2007 07:27:25 +0200 Peter Otten <[EMAIL PROTECTED]> wrote: > Martin Manns wrote: > > > Calling methods of other object instances seems quite expensive on > > the stack (see example below). Is there a better way of traversing > > through methods of instances that are connected in a

Re: Calling private base methods

2007-04-15 Thread Duncan Booth
"Isaac Rodriguez" <[EMAIL PROTECTED]> wrote: >> The fact that I had >> to resort to this trick is a big indication of course that genuinely >> private members (as opposed to a 'keep off' naming convention) are a bad >> idea in general. > > > The fact that you had to resort to this trick is a big

Re: Authenticating clients and servers

2007-04-15 Thread Chaz Ginger
Thomas Krüger wrote: > Chaz Ginger schrieb: >> I am writing a distributed server system using Python. I need to support >> authentication and was wondering what approaches are available under >> Python and what are the best practices. > > Well, there are many ways of client authentication. To narr

Re: tuples, index method, Python's design

2007-04-15 Thread Rhamphoryncus
On Apr 15, 8:56 am, Roel Schroeven <[EMAIL PROTECTED]> wrote: > Paul Rubin schreef: > > > "Rhamphoryncus" <[EMAIL PROTECTED]> writes: > >> Indexing cost, memory efficiency, and canonical representation: pick > >> two. You can't use a canonical representation (scalar values) without > >> some sort

Re: Authenticating clients and servers

2007-04-15 Thread Thomas Krüger
Thomas Krüger schrieb: > Many protocols support an additional SSL/TLS-Layers (e.g. HTTP -> > HTTPS). There you can use SSL certificate authentication. It may > berequired to set up a small CA, but done right it is pretty secure. I missed the best: The Twisted framework has SSL authentication alrea

  1   2   >