473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

c_string missing from ctypes?

Hello,

I was following along with this site:

http://www.brunningonline.net/simon/...es/000659.html

and I got a error. It boils down to:

====================

In [9]: import ctypes
In [10]: dir(ctypes.c_string)
---------------------------------------------------------------------------
<type 'exceptions.AttributeError' Traceback (most recent call
last)

P:\<ipython consolein <module>()

<type 'exceptions.AttributeError'>: 'module' object has no attribute
'c_string'

====================
I google ctypes.c_string and many people use it.

I am using python 2.5 with ctypes version: 1.0.1 on a windows
machine.

I have to admit I don't know where ctypes came from. I tried to re-
install it but the window binaries only support 2.4.

Also:

http://starship.python.net/crew/thel.../tutorial.html

seems dead.

An info is greatly appreciated.

jr

Feb 23 '07 #1
2 3350
On 23 Feb 2007 09:03:21 -0800, Jacob Rael <ja********@gmail.comwrote:
Hello,

I was following along with this site:

http://www.brunningonline.net/simon/...es/000659.html

and I got a error. It boils down to:

====================

In [9]: import ctypes
In [10]: dir(ctypes.c_string)
---------------------------------------------------------------------------
<type 'exceptions.AttributeError' Traceback (most recent call
last)

P:\<ipython consolein <module>()

<type 'exceptions.AttributeError'>: 'module' object has no attribute
'c_string'

====================
The tutorial is out of date, ctypes.c_string was removed somewhere
around version 0.6 (theres a comment to this effect in the comments
under the tutorial). You want ctypes.c_buffer instead.
>

I google ctypes.c_string and many people use it.

I am using python 2.5 with ctypes version: 1.0.1 on a windows
machine.

I have to admit I don't know where ctypes came from. I tried to re-
install it but the window binaries only support 2.4.
As of Python 2.5 ctypes is part of the standard library.
Also:

http://starship.python.net/crew/thel.../tutorial.html

seems dead.

An info is greatly appreciated.

jr

--
http://mail.python.org/mailman/listinfo/python-list
Feb 23 '07 #2
On 23 Feb 2007 09:03:21 -0800, Jacob Rael <ja********@gmail.comwrote:
I was following along with this site:

http://www.brunningonline.net/simon/...es/000659.html
You don't want to be messing around with that old rubbish. I should
know - I wrote it.

Instead, take a look at <http://www.openqa.org/pywinauto/>.
In [9]: import ctypes
In [10]: dir(ctypes.c_string)
---------------------------------------------------------------------------
<type 'exceptions.AttributeError' Traceback (most recent call
last)
<type 'exceptions.AttributeError'>: 'module' object has no attribute
'c_string'
I think that c_string has been replaced by c_buffer in recent versions
of ctypes.

--
Cheers,
Simon B
si***@brunningonline.net
http://www.brunningonline.net/simon/blog/
Feb 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Thomas Heller | last post by:
ctypes 0.9.2 released - Oct 28, 2004 ==================================== Overview ctypes is a ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call...
2
by: rrenaud | last post by:
Is there a reason why erf() is not included in the math package? According to the following URL it looks like it has been standard C since 1999. ...
1
by: sjdevnull | last post by:
Hey, I'm trying to wrap GNU readline with ctypes (the Python readline library doesn't support the callback interface), but I can't figure out how to set values to a variable inside the library. ...
7
by: p.lavarre | last post by:
How do I vary the byte offset of a field of a ctypes.Structure? How do I "use the dynamic nature of Python, and (re-)define the data type after the required size is already known, on a case by...
6
by: Jack | last post by:
I'm not able to build IP2Location's Python interface so I'm trying to use ctypes to call its C interface. The functions return a pointer to the struct below. I haven't been able to figure out how...
0
by: Egor Zindy | last post by:
Egor Zindy wrote: #!/usr/bin/env python """ A generic chipid library based on ctypes This module handles most of the functions in FTChipID.dll
3
by: Andrew Lentvorski | last post by:
Basically, I'd like to use the ctypes module as a much more descriptive "struct" module. Is there a way to take a ctypes.Structure-based class and convert it to/from a binary string? Thanks,...
4
by: taghi | last post by:
I want to call NetShareEnum, a function from netapi32.dll NetShareEnum has this definition: NET_API_STATUS NetShareEnum( __in LPWSTR servername, __in DWORD level, __out LPBYTE...
0
by: Tim Grove | last post by:
Thanks Martin (and others) for your advice. No, this solution didn't quite work either. Well, the extremely annoying thing is that it DOES work on another home pc, but on my laptop which I use for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.