Re: [Tutor] inheritance/classmethods/metaclasses

2008-06-19 Thread Eric Abrahamsen
What you have almost works. Try this: No kidding – that's what I get for wild stabs in the dark, I thought I'd tried that. I'm pleased that it really is that simple (and that, whatever metaclasses are used for, I don't need to worry about them yet). Thanks! Eric (Grrr, bit by the reply

Re: [Tutor] Learning Python from books

2008-06-19 Thread Lowell Tackett
"Python Programming [for the absolute beginner]" by Michael Dawson is-in my humble opinion-a programming pedagogical pacesetter. >From the virtual desk of Lowell Tackett --- On Thu, 6/19/08, Zameer Manji <[EMAIL PROTECTED]> wrote: > From: Zameer Manji <[EMAIL PROTECTED]> > Subject: [Tutor]

Re: [Tutor] Learning Python from books

2008-06-19 Thread Jason Conner
I use the same books - Learning Python and Core Python Programming, 2nd ed. I found I got about halfway through Learning Python before I switched to CPP and had no problems. I also use "Python Phrasebook" (Brad Dayley, 2007) as a handy reference guide to some common problems as well. Core Python P

Re: [Tutor] Learning Python from books

2008-06-19 Thread jay
Me personally, both "Learning Python" and "Core Python Programming". I am by no means an expert, but both of these books are excellent and were quite helpful. jay On Thu, Jun 19, 2008 at 1:56 PM, Zameer Manji <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > Has

[Tutor] Learning Python from books

2008-06-19 Thread Zameer Manji
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Has anyone here attempted to learn Python from books ? I recently purchased "Learning Python" 3rd Edition (9780596513986) and if anyone here is a good bottom-up learner than it is the perfect book. The author goes over each feature in python, explain

Re: [Tutor] inheritance/classmethods/metaclasses

2008-06-19 Thread Kent Johnson
On Thu, Jun 19, 2008 at 9:50 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > I'm making a few classes for a very simple ORM, where the classes reflect > objects that I'm persisting via pickle. I'd like to add and delete instances > via add() and delete() classmethods, so that the classes can keep

[Tutor] inheritance/classmethods/metaclasses

2008-06-19 Thread Eric Abrahamsen
I'm probably in over my head here, but I really want to know how this works, and I hope someone will be willing to take a moment to explain it... I'm making a few classes for a very simple ORM, where the classes reflect objects that I'm persisting via pickle. I'd like to add and delete in

Re: [Tutor] Newbie: Sorting lists of lists

2008-06-19 Thread Mark Tolonen
"Kent Johnson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, Jun 18, 2008 at 8:30 PM, Keith Troell <[EMAIL PROTECTED]> wrote: Let's say I have a list of lists l == [[1, 2, 3], [2, 3, 1], [3, 2, 1], [1, 3, 2]] If I do a l.sort(), it sorts on the first element of each lis

Re: [Tutor] compiling python

2008-06-19 Thread Kent Johnson
On Thu, Jun 19, 2008 at 7:11 AM, Sean Novak <[EMAIL PROTECTED]> wrote: > missed answering that last part before I sent the email. > > import urllib > import libxml2dom > import xml.dom.ext urllib is part of the standard lib. Perhaps you could replace the xml libs with something that is in the stan

Re: [Tutor] re adlines, read, and my own get_contents()

2008-06-19 Thread Kent Johnson
On Thu, Jun 19, 2008 at 2:44 AM, John [H2O] <[EMAIL PROTECTED]> wrote: > > I've defined: > > def get_contents(infile=file_object): > """ return a list of lines from a file """ > contents=infile.read() > contents = contents.strip().split('\n') > return contents > I think I understand the di

Re: [Tutor] compiling python

2008-06-19 Thread Kent Johnson
On Wed, Jun 18, 2008 at 11:29 PM, Sean Novak <[EMAIL PROTECTED]> wrote: > Hello Python Guru's and Newbies alike. I've been able to write a bit of > Python for a web app that works wonderfully on my dev machine. However, I > have limited access to the machine that will actually host this app. Wil

Re: [Tutor] Newbie: Sorting lists of lists

2008-06-19 Thread Kent Johnson
On Wed, Jun 18, 2008 at 10:48 PM, Forrest Y. Yu <[EMAIL PROTECTED]> wrote: > I know, it's NOT beautiful code, but it seems work. If you have no better > way, try this: > > """Sort on the second elements.""" > def xchg12(l) : > for m in l: > m[0], m[1] = m[1], m[0] > > l = [[1, 2, 3], [2

[Tutor] Two dimesional array

2008-06-19 Thread kinuthiA muchanE
On Thu, 2008-06-19 at 02:30 +0200, [EMAIL PROTECTED] wrote: > Message: 2 > Date: Wed, 18 Jun 2008 19:43:21 +0530 > From: "amit sethi" <[EMAIL PROTECTED]> > Subject: [Tutor] (no subject) > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859