Hello,
I am a newbie and i have problems filling an array with the mac address
read from the command line.
The mac address is FF:FF:FF:FF:FF:FF
options, args = parser.parse_args()
# options.d contains the address
destAddress = options.d
data = array('L', '\0' * 24)
The array should contain the d
Is it possible to join/append 2 arrays defined with different
typecodes?
What typecode should i use to generate the following output.
data1 = array('h', '\0', 6)
data2 = array('L', '\0', 25)
for i in range( 6):
data1[0] = 0xFF
data2[1] = 0x00
data1[2] = 0x00
data1[3] = 0x00
d
Thanks Steve.
There's a problem with Numeric array. I tried with numarray and it
works fine.
-SB
--
http://mail.python.org/mailman/listinfo/python-list
The table initializes to a 2 dimensional with zeros.
-SB
--
http://mail.python.org/mailman/listinfo/python-list
In function test(),
Read wi and bi as:
wi = val >> 4
bi = val & 0xFL
-SB
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
What's the problem with this code? I get the following error message:
File "test.py", line 26, in test
print tbl[wi][bi]
IndexError: index must be either an int or a sequence
---code snippet
from Numeric import *
tbl = zeros((32, 16))
def test():
val = testme()
wi = crc
Thats right. I wanted c1 and c2 to retrieve the values returned by t1
and t2 . Values for t1 and t2 could be anything. Also tbl is global.
-SB
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard wrote:
> [EMAIL PROTECTED] wrote:
> > from Numeric import *
> >
> > # Initialize the 32x16 global array to zeros
> > tbl = zeros((32, 16)
> >
> > def getValue( value):
> > data = test(value)
> > c1 = data[0]
> > c2 = data[1]
> > print tbl[c1, c2]
> >
> > def test( va
Hello,
I am getting the following error when returning a list:
return tbl[c1,c2]
"IndexError: each subindex must be either a slice, an integer,
Ellipsis, or NewAxis"
What does it mean?
Here's the code snippet
from Numeric import *
# Initialize the 32x16 global array to zeros
tbl = zeros(
The F.A.Q. does not explain how to create a 2 dimensional array and
initialize it to zero.
I need to iterate values by row and column as well.
I tried this
w,x = 32, 16
A = [ [0x0]*w for i in range(x)]
print A
It does not create a 2 dimensional array with 32 rows and 16 columns
Thanks,
-SB
Hello,
Can I do something like this?
table = {}
table[32, 16] = 0x0
Where 32 specifies rows and 16 specifies columns and i am trying to
initialize it to zero
I should be able to do comparisons like:
table[t1, t2] == 0x1 etc.
-SB
--
http://mail.python.org/mailman/listinfo/python-list
Whats the file that has to be mapped? Can this be a list? Can this list
be initialized to 512?
Thanks,
-SB
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
How do i create two memory mapped buffers(mmap) and pass an index to
select which one needs to be populated?
Is it possible to define the size of the buffer?
-SB
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo