ctypes 
Author Message
 ctypes

ctypes is a module allowing to create and manipulate C data types in
Python. These can then be passed to C-functions loaded from dynamic
link libraries.

This module is supposed to be a greatly enhanced and much more
complete replacement of Sam Rushing's calldll/npstruct/windll
modules. ctypes is not based on Sam's work, it has different roots.

It requires python 2.2 or higher, since it makes intensive use of the
new type system.

----

It provides classes which can be used to create complicated C data
types, for example, those used in Windows type libraries.

Included is a facility to dynamically load DLLs, retrieve functions,
and call them. You can also call methods on COM objects.

Implemented are simple data types (int, char, string, and so on),
function pointers (callbacks), structures, unions, arrays, and
pointers.

ctypes uses win32 structured exception handling, to make it as safe as
possible, although it is clear that it's easy to crash the Python
interpreter.

The source distribution contains an extensive, although inclomplete,
tutorial (which you can also read online), as well as example scripts
demonstrating the use.

One of these scripts contains a dynamic Dispatch implementation, which
is used to drive MS word as an example.

----

ctypes is not yet complete, this is an early release, but IMO it is
already entirely usable. Just don't be too astonished if later
versions have a different behaviour or api.

Homepage: http://www.*-*-*.com/
License: BSD
Platform: Windows (32 bit Intel)

----

Have fun,

Thomas



Tue, 26 Apr 2005 04:00:25 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ctypes 0.6.0 released

2. ctypes 0.4.0 released

3. A fast implementation of the C ctype functions

4. ctype module?

5. ctypes ques

6. calling a fortran dll from python with ctypes module

7. TIP #20: Add C Locale-Exact CType Functions

8. Tcl ctype.h equiv?

9. CTypes wnetaddconnection2

10. ctypes error

11. ctypes question

12. ctypes - c_buffer

 

 
Powered by phpBB® Forum Software