Gregory Ewing at 2018/4/15 PM 08:20 wrote:
Jach Fong wrote:
>>> pvoid = ctypes.c_void_p(ctypes.addressof(buf0))
>>> pvoid.contents
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'c_void_p' object has no attribute 'contents'
I think the 'contents' attribute only
Jach Fong wrote:
>>> pvoid = ctypes.c_void_p(ctypes.addressof(buf0))
>>> pvoid.contents
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'c_void_p' object has no attribute 'contents'
I think the 'contents' attribute only applies to pointers that are
pointing at part
On Sat, Apr 14, 2018 at 1:57 AM, Jach Fong wrote:
> eryk sun at 2018/4/14 PM 05:27 wrote:
>
>> The simple types c_void_p, c_char_p, and c_wchar_p are pointers.
>> However, since they subclass _SimpleCData instead of _Pointer, they
>> inherit the behavior of simple types.
>
>
eryk sun at 2018/4/14 PM 05:27 wrote:
On Fri, Apr 13, 2018 at 8:44 AM, Jach Fong wrote:
After studying the example you explained in your previous post replied to
Gregory Ewing, I had noticed that until today I was totally misunderstand
the meaning of the c_char_p. I
On Fri, Apr 13, 2018 at 8:44 AM, Jach Fong wrote:
>
> After studying the example you explained in your previous post replied to
> Gregory Ewing, I had noticed that until today I was totally misunderstand
> the meaning of the c_char_p. I always think it "is" a pointer, but
eryk sun at 2018/4/13 PM 12:16 wrote:
On Fri, Apr 13, 2018 at 12:38 AM, Jach Fong wrote:
Gregory Ewing at 2018/4/13 上午 07:25 wrote:
To get around this, you may need to declare the return type
as POINTER(c_char) instead:
For a general character pointer that may also
On Fri, Apr 13, 2018 at 12:38 AM, Jach Fong wrote:
> Gregory Ewing at 2018/4/13 上午 07:25 wrote:
>
>> To get around this, you may need to declare the return type
>> as POINTER(c_char) instead:
>>
>>> For a general character pointer that may also point to binary data,
>>
>> >
Gregory Ewing at 2018/4/13 上午 07:25 wrote:
On Thu, Apr 12, 2018 at 2:16 PM, wrote:
This C function returns a buffer which I declared it as a
ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid
data may vary from a few bytes to the whole size.
I think
On Thu, Apr 12, 2018 at 11:25 PM, Gregory Ewing
wrote:
>
> To get around this, you may need to declare the return type
> as POINTER(c_char) instead:
>
>> For a general character pointer that may also point to binary data,
>
>> POINTER(c_char) must be used.
>
> I'm not
On 12Apr2018 16:11, Jach Fong wrote:
This is the first time I am using python-list to interact with
comp.lang.python forum (because there are so many spam when using
browser to view it) so forgive me if something goes wrong.
Python already treat the returned buffer as
On Thu, Apr 12, 2018 at 2:16 PM, wrote:
This C function returns a buffer which I declared it as a
ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid
data may vary from a few bytes to the whole size.
I think we need to see the code you're using to call
On Apr 12, 2018 09:39, jf...@ms4.hinet.net wrote:
>
> Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
> > On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> > > This C function returns a buffer which I declared it as a
> > > ctypes.c_char_p. The buffer has size 0x1 bytes long
This is the first time I am using python-list to interact with
comp.lang.python forum (because there are so many spam when using
browser to view it) so forgive me if something goes wrong.
Python already treat the returned buffer as 'bytes'. The problem is
Python don't know its size (or
Chris Angelico於 2018年4月12日星期四 UTC+8下午4時05分29秒寫道:
> On Thu, Apr 12, 2018 at 4:20 PM, wrote:
> > Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
> >> On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> >> > This C function returns a buffer which I declared it as
On 11Apr2018 21:16, jf...@ms4.hinet.net wrote:
This C function returns a buffer which I declared it as a ctypes.c_char_p. The
buffer has size 0x1 bytes long and the valid data may vary from a few bytes
to the whole size.
Could you show us the function?
In every
On Thu, Apr 12, 2018 at 4:20 PM, wrote:
> Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
>> On Thu, Apr 12, 2018 at 2:16 PM, wrote:
>> > This C function returns a buffer which I declared it as a ctypes.c_char_p.
>> > The buffer has size 0x1
Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
> On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> > This C function returns a buffer which I declared it as a ctypes.c_char_p.
> > The buffer has size 0x1 bytes long and the valid data may vary from a
> > few bytes to the
On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> This C function returns a buffer which I declared it as a ctypes.c_char_p.
> The buffer has size 0x1 bytes long and the valid data may vary from a few
> bytes to the whole size.
>
> In every call I know how much the valid data
This C function returns a buffer which I declared it as a ctypes.c_char_p. The
buffer has size 0x1 bytes long and the valid data may vary from a few bytes
to the whole size.
In every call I know how much the valid data size is, but I suppose I can't use
slice to get it because there may be
19 matches
Mail list logo