Re: Append data to a list within a dict

2007-04-15 Thread Tina I
Alex Martelli wrote: > Tina I <[EMAIL PROTECTED]> wrote: >... >> He he... at the age of 40 I'm well beyond school work ;) > > Why would that be? My wife's over 40, yet she's a student (currently at > Stanford -- they were overjoyed to admit her, with lot of life > experience as well as previo

Re: Really badly structured Python Books.

2007-04-15 Thread readability
On Apr 14, 2:37 pm, "Andre P.S Duarte" <[EMAIL PROTECTED]> wrote: > I started reading the beginning Python book. It is intended for people > who are starting out in the Python world. But it is really > complicated, because he tries to explain, then after a bad explanation > he puts out a bad exampl

Re: proposed PEP: iterator splicing

2007-04-15 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > > Less clutter, and avoids yet another temp variable polluting the namespace. > Are we in danger of running out of temp variables? There is unfortunately no way to contain the scope of a loop index to the inside of the loop. Therefore introducing more

Re: tuples, index method, Python's design

2007-04-15 Thread Paul Rubin
"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 of costly search when indexing (O(log n) probably) or by > expanding to the worst-case size (UTF-32

Re: proposed PEP: iterator splicing

2007-04-15 Thread Anton Vredegoor
Paul Rubin wrote: > def some_gen(): >... >yield *some_other_gen() > > comes to mind. Less clutter, and avoids yet another temp variable > polluting the namespace. > > Thoughts? Well, not directly related to your question, but maybe these are some ideas that would help dete

Standardizing XML

2007-04-15 Thread ZeeGeek
Is there a module for python to standardize XML? Since MSN Live Space doesn't use standard XML in the posts, I want to standardize them so that I can use them elsewhere. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor/IDE on Linux?

2007-04-15 Thread Daniel Gee
In Linux I just use Gedit. In windows I settle for Notepad2. With python having help built into the interpreter, anything more than line numbering, simple syntax highlighting, and auto-indent when you hit enter just doesn't seem necessary. Vim has b and c, but not a. Using Kate for Python would pr

Re: Lists and Tuples and Much More

2007-04-15 Thread Hendrik van Rooyen
"James Stroud" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > > > But if you limit it to one thing and its inverse, its quite useful, and it > > would be nice to have one "doubledict" that can be accessed as speedily > > from either end... > > > > Sort of an internally linked list of

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

2007-04-15 Thread Nick Craig-Wood
Sherm Pendley <[EMAIL PROTECTED]> wrote: > "Paddy" <[EMAIL PROTECTED]> writes: > > > Having more than one index start point would be a maintenance > > nightmare best avoided. > > Quite right. > > > (It can be done in Perl). > > When was the last time you used Perl? It was allowed in Perl 4 a

Re: combination function in python

2007-04-15 Thread bearophileHUGS
DanielJohnson: > Please help, I couldnt find the function through help. You can't find it because it's not there: def factorial(n): """factorial(n): return the factorial of the integer n. factorial(0) = 1 factorial(n) with n<0 is -factorial(abs(n)) """ result = 1 for i in

Re: Python and XML?

2007-04-15 Thread Stefan Behnel
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 format. That's why I was a

Re: Standardizing XML

2007-04-15 Thread Stefan Behnel
ZeeGeek wrote: > Is there a module for python to standardize XML? Since MSN Live Space > doesn't use standard XML in the posts, I want to standardize them so > that I can use them elsewhere. Could you give a hint what you mean with "standardize"? What's non standardized XML for you? Stefan -- h

Re: Python editor/IDE on Linux?

2007-04-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Dotan Cohen wrote: > Has anyone any experience with Python in Kate or Kdevelop? I'm using Kate/KWrite quite often. Syntax highlighting and an auto indention for Python are standard features. The only "extra" I'm using is the word completion plug-in to spare myself too mu

Re: Python editor/IDE on Linux?

2007-04-15 Thread Paddy
On Apr 15, 9:33 am, "Daniel Gee" <[EMAIL PROTECTED]> wrote: > In Linux I just use Gedit. In windows I settle for Notepad2. With > python having help built into the interpreter, anything more than line > numbering, simple syntax highlighting, and auto-indent when you hit > enter just doesn't seem ne

Re: Getting started with python

2007-04-15 Thread James Stroud
Eric 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 what I should try and write. So I was hoping that > someone here could help point me to a group/project that would be a >

OverflowError: mktime argument out of range ???

2007-04-15 Thread Jorgen Bodde
Hi List I am working on an app to store guitar songs I am practicing, and for the fun of it I want to store the date of songs when they were originally made. So far so good.. However, my taste of music is "Rag Time Blues" and that os OLD, very OLD music. So it happened I entered a song from the

Re: combination function in python

2007-04-15 Thread Steven D'Aprano
On Sun, 15 Apr 2007 02:38:31 -0700, bearophileHUGS wrote: > DanielJohnson: >> Please help, I couldnt find the function through help. > > You can't find it because it's not there: > > def factorial(n): > """factorial(n): return the factorial of the integer n. > factorial(0) = 1 > fact

Re: tuples, index method, Python's design

2007-04-15 Thread Neil Hodgson
Paul Rubin: > I still don't get it. UTF-16 is just a data compression scheme, right? > I mean, s[17] isn't the 17th character of the (unicode) string regardless > of which memory byte it happens to live at? It could be that that accessing > it takes more than constant time, but that's hidden by

Re: OverflowError: mktime argument out of range ???

2007-04-15 Thread Michael Bentley
On Apr 15, 2007, at 5:41 AM, Jorgen Bodde wrote: > This is what I try: > time.mktime((1928, 12,28, 0, 0, 0, 0, 0, 0)) > Traceback (most recent call last): > File "", line 1, in > OverflowError: mktime argument out of range Probably depends on your system. It doesn't break for me: >>>

Re: OverflowError: mktime argument out of range ???

2007-04-15 Thread Diez B. Roggisch
Jorgen Bodde schrieb: > Hi List > > I am working on an app to store guitar songs I am practicing, and for > the fun of it I want to store the date of songs when they were > originally made. So far so good.. > > However, my taste of music is "Rag Time Blues" and that os OLD, very > OLD music. So

Re: Python editor/IDE on Linux?

2007-04-15 Thread 7stud
On Apr 15, 2:33 am, "Daniel Gee" <[EMAIL PROTECTED]> wrote: > > anything more than line > numbering, simple syntax highlighting, and auto-indent when you hit > enter just doesn't seem necessary. Vim has b and c, but not a. > a: :set nu :set nonu -- http://mail.python.org/mailman/listinfo/python-

Re: OverflowError: mktime argument out of range ???

2007-04-15 Thread Jorgen Bodde
Ok thanks, I missed out on datetime where the methods I need are also present. I'll be refactoring my data a bit, thanks again! - Jorgen On 4/15/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Jorgen Bodde schrieb: > > Hi List > > > > I am working on an app to store guitar songs I am practicin

Re: Standardizing XML

2007-04-15 Thread Jan Danielsson
ZeeGeek wrote: > Is there a module for python to standardize XML? Since MSN Live Space > doesn't use standard XML in the posts, I want to standardize them so > that I can use them elsewhere. Hmm... XML _is_ standardized. If it doesn't follow the specs, then it's not XML. If you want to make XM

Re: combination function in python

2007-04-15 Thread bearophileHUGS
Steven D'Aprano: > That's a naive and slow implementation. For even quite small values > of n and k, you end up generating some seriously big long ints, > and then have to (slowly!) divide them. > A better implementation would be something like this: You are right, thank you for the improvement (t

Re: function with list argument defaulting to [] - what's going on here???

2007-04-15 Thread Tim Leslie
On 14 Apr 2007 20:20:42 -0700, Paddy <[EMAIL PROTECTED]> wrote: > On Apr 15, 3:58 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: > > On Sat, 14 Apr 2007 17:33:11 -0800, Troy Melhase wrote: > > > On 4/14/07, Mike <[EMAIL PROTECTED]> wrote: > > >> While trying to write a recursive function involvin

Re: OverflowError: mktime argument out of range ???

2007-04-15 Thread John Machin
On Apr 15, 8:48 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 15, 2007, at 5:41 AM, Jorgen Bodde wrote: > > > This is what I try: > > time.mktime((1928, 12,28, 0, 0, 0, 0, 0, 0)) > > Traceback (most recent call last): > > File "", line 1, in > > OverflowError: mktime argument out

Re: combination function in python

2007-04-15 Thread Jussi Piitulainen
Steven D'Aprano writes: > bearophileHUGS wrote: ... >> return factorial(n) // (factorial(k) * factorial(n-k)) > > That's a naive and slow implementation. For even quite small values > of n and k, you end up generating some seriously big long ints, and > then have to (slowly!) divide them. A b

Re: proposed PEP: iterator splicing

2007-04-15 Thread Steven Bethard
Paul Rubin wrote: > The boilerplate > > def some_gen(): >... >for x in some_other_gen(): >yield x >... > > is so common (including the case where some_other_gen is the same as > some_gen, i.e. it's a recursive call) that I find myself wanting > a more d

Re: Getting started with python

2007-04-15 Thread Army1987
"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 need to learn how to write a Fizz-Buzz > program to get a job now-a-days :-) Some

Re: Getting started with python

2007-04-15 Thread [EMAIL PROTECTED]
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 what I should try and write. So I was hoping that > someone here could help poi

Re: Getting started with python

2007-04-15 Thread [EMAIL PROTECTED]
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 what I should try and write. So I was hoping that > someone here could help poi

Re: proposed PEP: iterator splicing

2007-04-15 Thread Kay Schluehr
On Apr 15, 10:23 am, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > I'm currently also fascinated by the new generator possibilities, for > example sending back a value to the generator by making yield return a > value. What I would like to use it for is when I have a very long > generator and I nee

Re: Getting started with python

2007-04-15 Thread Dorai
On Apr 15, 3:35 am, James Stroud <[EMAIL PROTECTED]> wrote: > Eric 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 what I should try and write. So I was hoping that > >

Re: tuples, index method, Python's design

2007-04-15 Thread Roel Schroeven
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 of costly search when indexing (O(log n) probably) or by >> expanding to t

Re: Calling private base methods

2007-04-15 Thread Isaac Rodriguez
> 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 indication that the library you were using is bad desi

Re: proposed PEP: iterator splicing

2007-04-15 Thread Anton Vredegoor
Kay Schluehr wrote: > Maybe you should start by developing a design pattern first and > publish it in the Cookbook. I have the fuzzy impression that the idea > you are after, requires more powerfull control structures such as > delimited continuations that are beyond ths scope of Pythons simple >

is laziness a programer's virtue?

2007-04-15 Thread Xah Lee
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: “Resistant to work or exertion;

Re: combination function in python

2007-04-15 Thread Mark Dickinson
On Apr 15, 8:37 am, Jussi Piitulainen <[EMAIL PROTECTED]> 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: how to strip the domain name in python?

2007-04-15 Thread Marko . Cain . 23
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 PROTECTED] wrote: > > > > Hi, > > > > I have a list of url names like this, and I am trying to strip out the > > > domain name using the f

Re: combination function in python

2007-04-15 Thread Anton Vredegoor
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 something I already posted a few times here. This implementation was unfortunate

Re: That might be the case for more complex objects...

2007-04-15 Thread Steve Holden
James Stroud wrote: > Bart Willems wrote: >> Dennis Lee Bieber wrote: [...] >> Lists behave as described above, integers and floats don't. >> >> By the way, a classic language like C has features like this too; >> they're called pointers. > > I think that after a += 1, a memory location with a 6

Re: how to strip the domain name in python?

2007-04-15 Thread Marc 'BlackJack' Rintsch
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 PROTECTED] wrote: >> >> > > Hi, >> >> > > I have a list of url names like this, and

Re: reading from sys.stdin

2007-04-15 Thread Steve Holden
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 error. In other >>> words, will stop on a blank line and not return EOFEr

Re: proposed PEP: iterator splicing

2007-04-15 Thread Georg Brandl
Steven Bethard schrieb: > Paul Rubin wrote: >> The boilerplate >> >> def some_gen(): >>... >>for x in some_other_gen(): >>yield x >>... >> >> is so common (including the case where some_other_gen is the same as >> some_gen, i.e. it's a recursive call) t

Re: how to strip the domain name in python?

2007-04-15 Thread Steven Howe
[EMAIL PROTECTED] 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 PROTECTED] wrote: Hi,

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

2007-04-15 Thread ecir . hana
Dear list, maybe I'm overlooking something obvious or this is not possible at all or I don't know. Please, consider the following code: ## insert here anything you like def changer(): change_i('changed_i') change_j('changed_j') def run(i='', j=''): ## insert here anything you lik

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

2007-04-15 Thread Javier Bezos
> 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 Dijkstra's argument is obsolete, as it is based on how array length

Re: tuples, index method, Python's design

2007-04-15 Thread Rhamphoryncus
On Apr 15, 1:55 am, Paul Rubin wrote: > "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 of costly search when inde

Authenticating clients and servers

2007-04-15 Thread Chaz Ginger
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. Thanks in advance Chaz -- http://mail.python.org/mailman/listinfo/python-list

Re: Standardizing XML

2007-04-15 Thread ZeeGeek
On Apr 15, 7:08 am, Jan Danielsson <[EMAIL PROTECTED]> wrote: > ZeeGeek wrote: > > Is there a module for python to standardize XML? Since MSN Live Space > > doesn't use standard XML in the posts, I want to standardize them so > > that I can use them elsewhere. > >Hmm... XML _is_ standardized.

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

2007-04-15 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Let me explain: First, changer() is kind of templating language so it > should be written down in this form - however, it can change during > run-time as you like. Basically, it is just ordinary python code which > changes (should change) the local variables of another f

Re: Standardizing XML

2007-04-15 Thread Jonathan Ballet
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 complain that this tag is not valid because it > doesn't have a closing tag.

Re: Standardizing XML

2007-04-15 Thread ZeD
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 attributes like "color" and "size" are not surrounded > by quot

Re: Authenticating clients and servers

2007-04-15 Thread Thomas Krüger
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 narrow it down it would be nice if

Re: is laziness a programer's virtue?

2007-04-15 Thread Dan Bensen
Xah Lee wrote: > Laziness, Perl, and Larry Wall > When the sorcerer Larry Wall said “The three chief virtues of a > programmer are: Laziness, Impatience and Hubris”, he used the word > “laziness” to loosely imply “natural disposition that results in being > economic”. Programming by definition is

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

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

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

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

  1   2   >