overflowerror!!

A

ashtonn

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 = val

print data

How do i fill in the val 256 times into the array?

-Ashton
 
A

ashtonn

I tried that. Still get an Overflowerror: unsigned long is less than
minimum.

-Ashton
 
W

Will McGugan

I tried that. Still get an Overflowerror: unsigned long is less than
minimum.

You'll also need to reserve enough space for the 256 ints. Try this..

data = array('L', '\0' * 256*4)


Will
 
J

John Machin

Will said:
You'll also need to reserve enough space for the 256 ints. Try this..

data = array('L', '\0' * 256*4)

I don't understand. Why not just do the whole thing simply and cleanly,
like this:

data = array('L', 256 * [0xffffffff])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,240
Messages
2,571,211
Members
47,845
Latest member
vojosay

Latest Threads

Top