[Tutor] Write array to Status text

Stanfield, Vicki {D167~Indianapolis} VICKI.STANFIELD at roche.com
Mon Nov 17 14:17:11 EST 2003


I don't know if this made it to the list or not. Here is the code that I
tried. It doesn't work correctly. The new values don't get appended to
the array.

------------------------------------
errorarray=array('i', [0]*10)

<snip part where returnedval gets set to hexadecimal value.>

if count == 1:
         errorarray.append(returnedval)

StatusText=errorarray[0:4].tostring()
self.frame.SetStatusText(StatusText)
print errorarray[0:4]
------------------------------------

Can you see what I am doing wrong here?

--vicki


-----Original Message-----
From: tutor-bounces at python.org [mailto:tutor-bounces at python.org] On
Behalf Of Stanfield, Vicki {D167~Indianapolis}
Sent: Monday, November 17, 2003 1:10 PM
To: Vicki Stanfield; tutor at python.org
Subject: RE: [Tutor] Write array to Status text


Okay, it looks like an array but when I do this I get an error saying
that:

'list' object has no attribute 'tostring'

So I guess it is really a list. It looks so much like an array in C. I'm
afraid that I don't see the reason for both existing. Is there a place
where I can find out more about the differences? I'm sure that I could
use a real array for what I am doing if I only understood the difference
between arrays and lists.

--vicki




More information about the Tutor mailing list