Re: No trees in the stdlib?

2009-06-26 Thread greg
João Valverde wrote: What's lacking is an associative array that preserves ordering, doesn't require a hash function and has fast insertions and deletions in O(log(n)). Careful here -- you can't get away from the need for hashability just by using a tree. Even if you don't need to actually ha

Re: change the first character of the line to uppercase in a text file

2009-06-26 Thread powah
On Jun 26, 4:51 pm, Chris Rebert wrote: > On Fri, Jun 26, 2009 at 12:43 PM, powah wrote: > > How to change the first character of the line to uppercase in a text > > file? > > e.g. > > input is: > > abc xyz > > Bd ef > > gH ij > > > output should be: > > Abc xyz > > Bd ef > > GH ij > > We're not i

Re: looking for a book on python

2009-06-26 Thread Aahz
In article , Randy Foiles wrote: > > I do realize that everyone is different but I would like to see some >suggestions and maybe reasons why you think it is good. I have looked >for/searched and found a few different books but as my means are a bit >limited right now I don't really want

Beginning with Python; the right choice?

2009-06-26 Thread sato.ph...@gmail.com
Hi, As you can imagine, I am new, both to this group and to Python. I have read various posts on the best book to buy or online tutorial to read and have started to go through them. I was wondering, as someone with virtually no programming experience (I am a photographer by trade), is Python the

Re: Beginning with Python; the right choice?

2009-06-26 Thread Amos Anderson
In learning most programming languages, in my experience anyway, it's easy to get overwhelmed and want to give up. Python is easy enough that you should be able to pick it to a point that it will be useful to you while still learning the more advanced features. Python generally teaches good program

Re: Beginning with Python; the right choice?

2009-06-26 Thread Mensanator
On Jun 26, 9:22�pm, "sato.ph...@gmail.com" wrote: > Hi, > > As you can imagine, I am new, both to this group and to Python. �I > have read various posts on the best book to buy or online tutorial to > read and have started to go through them. �I was wondering, as someone > with virtually no progra

postgreSQL python bindings - which one?

2009-06-26 Thread Horace Blegg
Hi, I'm having a hard time deciding which set of PGSQL python bindings to go with. I don't know much about SQL to begin with, so the collage of packages of somewhat daunting. I'm starting a pet project in order to teach my self more, but I want to avoid getting off on the wrong foot and picking a p

Re: ctypes list library

2009-06-26 Thread Gabriel Genellina
En Thu, 25 Jun 2009 06:15:57 -0300, luca72 escribió: Hello but find_library find only the lib. but if i need to load from a list of lib how i have to do. My proble is that i have 5 lib (a,b,c,d,e), if i load the a i get lib b not found, if for first i load the b and than the a i get the same er

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
greg wrote: João Valverde wrote: What's lacking is an associative array that preserves ordering, doesn't require a hash function and has fast insertions and deletions in O(log(n)). Careful here -- you can't get away from the need for hashability just by using a tree. Even if you don't need t

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: greg wrote: João Valverde wrote: What's lacking is an associative array that preserves ordering, doesn't require a hash function and has fast insertions and deletions in O(log(n)). Careful here -- you can't get away from the need for hashability just by using a tree. Ev

Re: No trees in the stdlib?

2009-06-26 Thread CTO
On Jun 26, 1:29 am, Tom Reed wrote: > Whynotrees in the standard library, if not as a built in? I searched > the archive but couldn't find a relevant discussion. Seems like a > glaring omission considering the batteries included philosophy, > particularly balanced binary search trees.Nointerest,no

Re: Dictionary self lookup

2009-06-26 Thread Gabriel Genellina
En Wed, 24 Jun 2009 23:42:03 -0300, Carl Banks escribió: On Jun 24, 2:39 am, Norberto Lopes wrote: What do you think of dictionaries having a self lookup in their declaration? Be able to do this: a = {"foo" : "foo1", "bar" : a["foo"]} # or with another syntax instead of: a = { "foo" : "

Re: Beginning with Python; the right choice?

2009-06-26 Thread Terry Reedy
sato.ph...@gmail.com wrote: Hi, As you can imagine, I am new, both to this group and to Python. I have read various posts on the best book to buy or online tutorial to read and have started to go through them. I was wondering, as someone with virtually no programming experience (I am a photogr

Re: Beginning with Python; the right choice?

2009-06-26 Thread Chris Rebert
On Fri, Jun 26, 2009 at 10:39 PM, Terry Reedy wrote: > sato.ph...@gmail.com wrote: >> >> Hi, >> >> As you can imagine, I am new, both to this group and to Python.  I >> have read various posts on the best book to buy or online tutorial to >> read and have started to go through them.  I was wonderin

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Aahz wrote: In article , =?ISO-8859-1?Q?Jo=E3o_Valverde?= wrote: What's lacking is an associative array that preserves ordering, doesn't require a hash function and has fast insertions and deletions in O(log(n)). The particular algorithm to achieve this is a secondary issue. It's a BST fo

Re: Beginning with Python; the right choice?

2009-06-26 Thread Che M
On Jun 26, 10:22 pm, "sato.ph...@gmail.com" wrote: > Hi, > > As you can imagine, I am new, both to this group and to Python.  I > have read various posts on the best book to buy or online tutorial to > read and have started to go through them.  I was wondering, as someone > with virtually no progr

Re: Replacing a built-in method of a module object instance

2009-06-26 Thread Peter Otten
David Hirschfield wrote: > I have a need to replace one of the built-in methods of an arbitrary > instance of a module in some python code I'm writing. > > Specifically, I want to replace the __getattribute__() method of the > module I'm handed with my own __getattribute__() method which will do

Re: No trees in the stdlib?

2009-06-26 Thread Stefan Behnel
João Valverde wrote: > I wouldn't consider anything other than C for such a module on > efficiency alone, unless it was a prototype of course. But I have little > knowledge about the Python C API. Cython is your true friend, if only for rapid prototyping. http://cython.org/ Stefan -- http://mai

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-26 Thread Stefan Behnel
Kee Nethery wrote: > On Jun 25, 2009, at 11:39 PM, Stefan Behnel wrote: >> parsing a >> document from a string does not have its own function, because it is >> trivial to write >> >> tree = parse(BytesIO(some_byte_string)) > > :-) Trivial for someone familiar with the language. For a newbie li

Re: Python simple web development

2009-06-26 Thread laplacia...@gmail.com
On Jun 26, 6:08 pm, Thomas Allen wrote: > On Jun 25, 3:29 am, Private Private wrote: > > > > Can you suggest anything ? > > I don't think anything's lighter than web.py. > > http://webpy.org/ > My impression is that webpy is intended for experienced users who might otherwise just write all their

Re: It's ...

2009-06-26 Thread Gabriel Genellina
En Thu, 25 Jun 2009 14:07:19 -0300, Angus Rodgers escribió: On Thu, 25 Jun 2009 17:56:47 +0100, I burbled incoherently: [...] does the new feature, by which a file becomes iterable, operate by some kind of coercion of a file object to a list object, via something like x.readlines()? Sorry

Re: looking for a book on python

2009-06-26 Thread laplacia...@gmail.com
On Jun 26, 8:48 pm, Randy Foiles wrote: > Hello and thank you for taking your time to read this. >         I was interested in learning about python.  In the long ago past I did > learn some programing but I have not used any of it for years.  I do > remember some basics however so the book does n

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: Aahz wrote: In article , =?ISO-8859-1?Q?Jo=E3o_Valverde?= wrote: Anyway, I'm *not* trying to discourage you, just explain some of the roadblocks to acceptance that likely are why it hasn't already happened. If you're serious about pushing this through, you have two op

Re: Python simple web development

2009-06-26 Thread laplacia...@gmail.com
On Jun 27, 2:25 am, "laplacia...@gmail.com" wrote: > > As Thomas suggests, maybe have a look at Werkzeug ... Typo: s/Thomas/Petr/ -- http://mail.python.org/mailman/listinfo/python-list

<    1   2