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

2008-06-18 Thread John [H2O]
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 then there's also: file_object.read() and file_object.readlines() and file_object.readline() I think I

[Tutor] compiling python

2008-06-18 Thread Sean Novak
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. Will compiling a Python program eliminate library dependency requirements

Re: [Tutor] Newbie: Sorting lists of lists

2008-06-18 Thread Forrest Y. Yu
> > Message: 8 > Date: Wed, 18 Jun 2008 19:30:05 -0500 > From: Keith Troell <[EMAIL PROTECTED]> > Subject: [Tutor] Newbie: Sorting lists of lists > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > Let's say I have a li

Re: [Tutor] Newbie: Sorting lists of lists

2008-06-18 Thread Kent Johnson
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 listed list: > l.sort() l > [[1, 2, 3], [1, 3, 2], [2, 3, 1], [3, 2

Re: [Tutor] Newbie: Sorting lists of lists

2008-06-18 Thread John Fouhy
On 19/06/2008, 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 listed list: > > >>> l.sort() > >>> l > [[1, 2, 3], [1, 3, 2], [2, 3, 1], [3, 2, 1]] > > >

[Tutor] Newbie: Sorting lists of lists

2008-06-18 Thread Keith Troell
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 listed list: >>> l.sort() >>> l [[1, 2, 3], [1, 3, 2], [2, 3, 1], [3, 2, 1]] How can I sort on the second or third elements of the listed lists? Keith

Re: [Tutor] traverse a two dimensional array

2008-06-18 Thread Emil
> Date: Wed, 18 Jun 2008 19:43:21 +0530 > From: [EMAIL PROTECTED] > To: tutor@python.org > Subject: [Tutor] (no subject) > > Hi , Could you please tell me , how i can traverse a two dimensional array , > i am sorry , it must be pretty simple but I am new to pytho

Re: [Tutor] traverse a two dimensional array

2008-06-18 Thread bob gailer
amit sethi wrote: Hi , Could you please tell me , how i can traverse a two dimensional array , i am sorry , it must be pretty simple but I am new to python am not able to understand. How did you create the array? How have you tried to traverse it? What do you mean by traverse? -- Bob Gaile

[Tutor] Traversing a two-dimensional "array"(was: (no subject)

2008-06-18 Thread Terry Carroll
On Wed, 18 Jun 2008, amit sethi wrote: > Hi , Could you please tell me , how i can traverse a two dimensional array , > i am sorry , it must be pretty simple but I am new to python am not able to > understand. What many languages would call a two-dimensional array would be represented in Python

Re: [Tutor] when is object relational mapping for Python warranted?

2008-06-18 Thread Che M
Thank you both to Tim Golden and Jeff Younker for your helpful responses last week [see archive] about ORMs in Python/SQLite. Very helpful, and I'll get around to giving it a try one of these days... Che From: [EMAIL PROTECTED] To: tutor@python.org Subject: when is object relational mapping for

Re: [Tutor] Python Gotcha - List Question

2008-06-18 Thread Dick Moores
At 10:07 PM 6/16/2008, Guess?!? wrote: I am reading Think Python: An Introduction to Software Design This is a recent major revision of a book familiar to many, How to Think Like a Computer Scientist: Learning with Python. Dick Moores __

[Tutor] (no subject)

2008-06-18 Thread amit sethi
Hi , Could you please tell me , how i can traverse a two dimensional array , i am sorry , it must be pretty simple but I am new to python am not able to understand. -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/li

Re: [Tutor] Using SAPI 5 Voices and Methods

2008-06-18 Thread FT
As a note to this message post: the error I was getting for both the spell and the isfilename was traced down to simple factors. One problem is finding clear explanations and then checking the erroor codes. I found both on the issues mentioned about the SAPI 5 issues. The test I was ru