overflowerror!!

Will McGugan news at NOwillmcguganSPAM.com
Thu May 26 17:35:20 EDT 2005


ashtonn at gmail.com wrote:
> Hello,
> I am trying to fill in a dword value into an array and i get an
> overflowerror
> 
> Here's what iam trying to do.
> 
> from array import *
> data = array('B', '\0' * 256)
> 
> val = 0xFFFFFFFF
> 
> for i in range(256):
>     data[i] = val
> 
> print data
> 
> How do i fill in the val 256 times into the array?

'B' creates bytes, and a byte can only store numbers in the range 0 to 
255. Try using 'L' when creating your array.

Will McGugan
-- 
http://www.willmcgugan.com
"".join( [ {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-84)%26) for c 
in "jvyy*jvyyzpthtna^pbz" ] )



More information about the Python-list mailing list