473,411 Members | 1,894 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,411 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 3357
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.