momobear schrieb:
hi, is there a way to let python operate on sequence of int or short?
In C, we just need declare a point, then I could get the point value,
just like:
short* k = buffer, //k is a point to a sequence point of short.
short i = *k++,
but python is a dynamic language,
a =
momobear wrote:
hi, is there a way to let python operate on sequence of int or short?
In C, we just need declare a point,
I assume you mean a 'pointer'.
then I could get the point value,
just like:
short* k = buffer, //k is a point to a sequence point of short.
short i = *k++,
but python
but what about buffer is not be declared in python program, it comes
from a C function. and what about I want to treat a string as a short
list?
buffer = foobur() // a invoke from C function, it is encapsulated as a
string
but I want to treat it as a short list. how can I?
--
momobear wrote:
but what about buffer is not be declared in python program, it comes
from a C function. and what about I want to treat a string as a short
list?
OT level='slightly'
There are no short in Python. An integer is an integer is an integer...
/OT
buffer = foobur() // a invoke from
momobear wrote:
hi, is there a way to let python operate on sequence of int or short?
In C, we just need declare a point, then I could get the point value,
just like:
short* k = buffer, //k is a point to a sequence point of short.
short i = *k++,
but python is a dynamic language,
a =
then how can I convert it to a int list? I read about struct and array,
I think they are not suitable, since I don't know how long will the
buffer is. I know if I write a plugins modules in C should works, but
that's really upset to tell to myself there is no way in Python.
--
Hi momobear
then how can I convert it to a int list? I read about struct and array,
I think they are not suitable, since I don't know how long will the
buffer is. I know if I write a plugins modules in C should works, but
that's really upset to tell to myself there is no way in Python.
this
momobear wrote:
then how can I convert it to a int list? I read about struct and array,
I think they are not suitable, since I don't know how long will the
buffer is. I know if I write a plugins modules in C should works, but
that's really upset to tell to myself there is no way in Python.
momobear [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
then how can I convert it to a int list? I read about struct and array,
I think they are not suitable, since I don't know how long will the
buffer is. I know if I write a plugins modules in C should works, but
that's really
momobear wrote:
hi, is there a way to let python operate on sequence of int or short?
If you want to work with arrays of numbers, you might want to
look at NumArray etc.
--
http://mail.python.org/mailman/listinfo/python-list
momobear wrote:
but what about buffer is not be declared in python program, it comes
from a C function. and what about I want to treat a string as a short
list?
Python is a high level language with much stronger typing than C.
If you want a list of integers, use a list of integers. Strings
are
bruno at modulix [EMAIL PROTECTED] wrote:
momobear wrote:
but what about buffer is not be declared in python program, it comes
from a C function. and what about I want to treat a string as a short
list?
OT level='slightly'
There are no short in Python. An integer is an integer is an
thanks for help. formerly I only know to use the struct like bellow:
unpack('hhl', '\x00\x01\x00\x02\x00\x00\x00\x03')
Great, python can work like this:
l = list(struct.unpack('h'*(len(s)/2), s))
I will try to use the numarray also
there are some good exensions for Python,
numarray and numpy and
hi, is there a way to let python operate on sequence of int or short?
In C, we just need declare a point, then I could get the point value,
just like:
short* k = buffer, //k is a point to a sequence point of short.
short i = *k++,
but python is a dynamic language,
a = buffer
i = ? I don't know how
14 matches
Mail list logo