ctypes for IronPython (preliminary)

S

Sanghyeon Seo

ctypes is a popular CPython extension planned for inclusion in Python
2.5. It is a foreign function interface library.

Homepage: http://starship.python.net/crew/theller/ctypes/
Documentation: http://docs.python.org/dev/lib/module-ctypes.html

I would like to announce a preliminary implementation of ctypes for
IronPython using .NET's P/Invoke machinery.

Code is here: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ctypes.py
Example is here: http://sparcs.kaist.ac.kr/~tinuviel/fepy/example/ctypes_test.py

The example can be run on IronPython as well as on CPython.

What's missing:
* Many primitive types
* .value on primitive types
* Buffers and .raw
* Pointer and .contents
* Reference
* Array
* Structure and union and .offset
* Recursive type
* Callback
* External value
* Windows goodies

In short, everything except those needed to demo anything interesting.
:) But you can do this now:

IronPython 1.0.60523 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
Enjoy!

Seo Sanghyeon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top