Prev: whrandom Up: Miscellaneous Services Top: Top
array
'c''b''h''i''l''f''d'
See also built-in module struct.
The module defines the following function:
fromlist() or fromstring() method (see below) to add
initial items to the array.
EOFError is raised, but the items that were
available are still inserted into the array. f must be a real
built-in file object; something else with a read() method won't
do.
for x in list: a.append(x)
except that if there is a type error, the array is unchanged.
fromfile() method).
tofile() method.)
array(typecode, initializer). The
initializer is omitted if the array is empty, otherwise it is a
string if the typecode is 'c', otherwise it is a list of
numbers. The string is guaranteed to be able to be converted back to
an array with the same type and value using reverse quotes
(``). Examples:
array('l')
array('c', 'hello world')
array('l', [1, 2, 3, 4, 5])
array('d', [1.0, 2.0, 3.14])