Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Luke Paireepinart
James Matthews wrote: > http://www.goldwatches.com/watches.asp?Brand=39 Also, please stop spamming us with this link. You have a gmail account, so there's no reason for us to believe that you are required to put it there by a company you work for or otherwise. It's annoying. -Luke ___

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Luke Paireepinart
James Matthews wrote: > When the CPU writes to the RAM the 0th location can be written to also. When > you alter components of a language for example changing the way an list is > indexed you have to be careful because you can accidently jump out of > bounds! def indexOneBased(somelist,index):

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread James Matthews
When the CPU writes to the RAM the 0th location can be written to also. When you alter components of a language for example changing the way an list is indexed you have to be careful because you can accidently jump out of bounds! http://www.goldwatches.com/watches.asp?Brand=39 - Original Me

Re: [Tutor] words and lengths

2007-05-17 Thread calitar
James Matthews wrote: > Please include some code? > > http://www.goldwatches.com/watches.asp?Brand=39 Um...why does that link go to a page with expensive watches? Please no spamming on this mailing list. - Cole Armer ___ Tutor maillist - Tutor@pytho

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Bob Gailer
James Matthews wrote: > Also computer start counting from 0 No no. Computers don't count. Programs count. And they start whereever you program them to start. Recall that humans count from 1 because of some historic evolution. The introduction of zero into human arithmetic came many centuries aft

Re: [Tutor] help with arrays

2007-05-17 Thread Rikard Bosnjakovic
On 5/18/07, Stephen Adler <[EMAIL PROTECTED]> wrote: > or something like that which would create a string 100 characters > long. And then use that as input into the array module so that I can > build up an array. What's the standard convention to do this? a = " " * 100 > How do I create

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread James Matthews
Also computer start counting from 0 you can change this when you learn the language more but it isn't recommended! http://www.goldwatches.com/watches.asp?Brand=39 - Original Message - From: "Luke Paireepinart" <[EMAIL PROTECTED]> To: "Alan Gilfoy" <[EMAIL PROTECTED]> Cc: Sent: Thursday,

[Tutor] help with arrays

2007-05-17 Thread Stephen Adler
Guys, I'm quite new to python and come from a c++/old school math/computing/physics background. My main road block I have right now is that I can't for the life of me figure out how to allocate a 1meg buffer. (or any arbitrary sized buffer) without using something like the range function. It w

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Luke Paireepinart
Alan Gilfoy wrote: > Why Python starts counting at [0] instead of at [1] is a whole other issue. :D > > array = [["0.0", "0.1"], ["1.0", "1.1"]] > > array[0[1]] seems right, although it isn't, because the index (0) and > the subindex(1) are nested in 'array[0[1]]' much like the list and > subli

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Alan Gilfoy
Why Python starts counting at [0] instead of at [1] is a whole other issue. :D array = [["0.0", "0.1"], ["1.0", "1.1"]] array[0[1]] seems right, although it isn't, because the index (0) and the subindex(1) are nested in 'array[0[1]]' much like the list and sublist that I'm "calling" from with

Re: [Tutor] words and lengths

2007-05-17 Thread James Matthews
Please include some code? http://www.goldwatches.com/watches.asp?Brand=39 - Original Message - From: "Rikard Bosnjakovic" <[EMAIL PROTECTED]> To: "Emad Nawfal" <[EMAIL PROTECTED]> Cc: Sent: Thursday, May 17, 2007 3:57 AM Subject: Re: [Tutor] words and lengths > On 5/16/07, Emad Nawfal

Re: [Tutor] urllib.urlencode and unicode strings

2007-05-17 Thread Kent Johnson
Jon Crump wrote: > Dear all, > > I've got a python list of data pulled via ElementTree from an xml file > that contains mixed str and unicode > strings, like this: > > [u'Jumi\xe9ge, Normandie', 'Farringdon, Hampshire', 'Ravensworth, > Durham', 'La Suse, Anjou', 'Lions, Normandie', 'Lincoln,

[Tutor] urllib.urlencode and unicode strings

2007-05-17 Thread Jon Crump
Dear all, I've got a python list of data pulled via ElementTree from an xml file that contains mixed str and unicode strings, like this: [u'Jumi\xe9ge, Normandie', 'Farringdon, Hampshire', 'Ravensworth, Durham', 'La Suse, Anjou', 'Lions, Normandie', 'Lincoln, Lincolnshire', 'Chelmsford, Esse

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Alan Gauld
"Alan Gilfoy" <[EMAIL PROTECTED]> wrote array = [["1.1", "1.2"], ["2.1", "2.2"]] array[1[2]] This is trying to get the second element of 1. But one doesn't have a second element, hence the error. Just add an extra bracket: array[1][2] But that won;t work either because the index star

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Kent Johnson
Alan Gilfoy wrote: > Ah, a simple concept. Good. :) > I'm already familiar in working with lists. > > Here's a case of a simple two-dimensional array (the simplest > possible), ran in the IDLE interpreter: > array = [["1.1", "1.2"], ["2.1", "2.2"]] array[1[2]] > > Traceback (most rec

Re: [Tutor] I want some help with arrays...

2007-05-17 Thread Alan Gilfoy
Ah, a simple concept. Good. :) I'm already familiar in working with lists. Here's a case of a simple two-dimensional array (the simplest possible), ran in the IDLE interpreter: >>> array = [["1.1", "1.2"], ["2.1", "2.2"]] >>> array[1[2]] Traceback (most recent call last): File "", line 1, i

[Tutor] I want some help with arrays...

2007-05-17 Thread Alan Gilfoy
What is the best (only?) way to set up an array in Python. I've heard they can be quite good for certain types of data you need to organize... What IS the best reason(s) to be using an array? Apologies, if Python has something similar by a different name.

Re: [Tutor] File access by os.system

2007-05-17 Thread Rikard Bosnjakovic
On 5/16/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > Not Quite, I think. I'm sorry, I missed the fact about using the tempfile. I parsed Mike's post being a sole question about sending a var-args string to os.command(). -- - Rikard - http://bos.hack.org/cv/ __

Re: [Tutor] words and lengths

2007-05-17 Thread Rikard Bosnjakovic
On 5/16/07, Emad Nawfal <[EMAIL PROTECTED]> wrote: > What's wrong with it, and how can I fix it? Alas, we are not mind readers. Instead of letting others guess, it's usually a better idea to write any syntax errors - or whatever - Python complains, or what the result you expect it to be, and what