[Tutor] i'm a guy

Benoit Dupire bdupire@seatech.fau.edu
Mon, 02 Apr 2001 16:52:30 -0400


Got too many chat propositions ???
 :)))))))))))

(Just kidding!)

ooops! yes, I wrote something like 'she' in my post.... sorry!

Just to go back to the issue, the 'Array' module defines a new object
type which can efficiently represent an array of basic values:
characters, integers, floating point numbers. Arrays are sequence types
and behave very much like lists, except that the type of objects stored
in them is constrained.


You can concatenate 2 arrays like this...

>>> import array
>>> a= array.array('I', [11, 32, 35, 1, 5])
>>> b= array.array('I', [8, 11, 12])
>>> a[0:0]=b
>>> print a
array('I', [8L, 11L, 12L, 11L, 32L, 35L, 1L, 5L])
>>> c=a.tolist()
>>> print c
[8L, 11L, 12L, 11L, 32L, 35L, 1L, 5L]

The tolist() method converts it to a list.... it's just an optimization.

Look at:
http://www.python.org/doc/current/lib/module-array.html


Katharine Stoner wrote:

> Dear python people, I'm a guy named Cameron.  Katharine is my mom.
> I'm just using her account. -Cameron

--
Benoit Dupire
Graduate Student
----------------
I'd like to buy a new Boomerang. How can i get rid of the old one?