Re: Why these don't work??

2010-04-08 Thread M. Hamed
eally need them. Plus it gives me more justification for the time I invested learning a new language (and glad I did), and more reasons to dump Perl forever! Thanks for all the suggestions. On Apr 8, 1:37 pm, Joaquin Abian wrote: > On Apr 8, 10:08 pm, "M. Hamed" > wrote: > >

Re: Dynamically growing an array to implement a stack

2010-04-08 Thread M. Hamed
Thanks Patrick, that is what I was exactly looking for. Paul, thanks for your example. wasn't familiar with the stack class. I feel Patrick's method is a lot simpler for my purpose. Regards. On Apr 8, 1:29 pm, Patrick Maupin wrote: > On Apr 8, 3:21 pm, "M. Hamed"

Dynamically growing an array to implement a stack

2010-04-08 Thread M. Hamed
I have trouble with some Python concept. The fact that you can not assign to a non-existent index in an array. For example: a = [0,1] a[2] => Generates an error I can use a.append(2) but that always appends to the end. Sometimes I want to use this array as a stack and hence my indexing lo

Re: Why these don't work??

2010-04-08 Thread M. Hamed
e the numpy.zeros()? I know I can do it with list comprehension (like [0 for i in range(0,20)] but these are too many keystrokes for python :) I was wondering if there is a simpler way. I had another question about arrays but I should probably start another thread. Regards, On Apr 8, 11:43 am, MRAB wrote

Why these don't work??

2010-04-08 Thread M. Hamed
I'm trying the following statements that I found here and there on Google, but none of them works on my Python 2.5, are they too old? or newer? "abc".reverse() import numpy -- http://mail.python.org/mailman/listinfo/python-list