473,408 Members | 2,417 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,408 software developers and data experts.

typemaps

3
I have a C structure
Expand|Select|Wrap|Line Numbers
  1.         struct level
  2.         {
  3.                   int i[10];
  4.                   char ch[30];
  5.                   int a;
  6.        };
I'm using SWIG to convert this C structure to python.
Can anyone tell me how to write the Typemap with respect to this structure in the SWIG interface file.?

thanks in advance,
ruud
Mar 14 '07 #1
4 1302
bartonc
6,596 Expert 4TB
I have a C structure
Expand|Select|Wrap|Line Numbers
  1.         struct level
  2.         {
  3.                   int i[10];
  4.                   char ch[30];
  5.                   int a;
  6.        };
I'm using SWIG to convert this C structure to python.
Can anyone tell me how to write the Typemap with respect to this structure in the SWIG interface file.?

thanks in advance,
ruud
Hi ruud. I was using swig right up until I started struggling with typemaps. To my good fortune, I discovered the ctypes library and used swig since. Have you subscibed to the swig mail list yet?
Mar 14 '07 #2
ruud
3
Hi ruud. I was using swig right up until I started struggling with typemaps. To my good fortune, I discovered the ctypes library and used swig since. Have you subscibed to the swig mail list yet?

Yeah, I have subscribed to the swig mailing list. I havent found any solution there also.

Awaiting a solution,
Ruud.
Mar 14 '07 #3
ruud
3
can you briefly tell me what this ctypes library and how it will help me?

thanks
Mar 15 '07 #4
bartonc
6,596 Expert 4TB
can you briefly tell me what this ctypes library and how it will help me?

thanks
There is a ctypes article in the Python Forum: Articles section of this site.
Mar 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: kj.kjn | last post by:
My function func(File * des) is embedded in a module swig. I would to know how to call this function from python script and if it's necessay to declare a typemaps ? Thank you
2
by: Letbetter, Jason | last post by:
I'm creating Python extensions for several c/c++ components. I'm using swig to create the extensions. The biggest challenge so far is working with the c args between Python and the Python...
1
by: Nils Wagner | last post by:
Hi all, Has someone written a C binding to transfer matrices from C to Python and vice versa ? Any pointer would be appreciated. Nils
13
by: Roy Smith | last post by:
I've got a C library with about 50 calls in it that I want to wrap in Python. I know I could use some tool like SWIG, but that will give me a too-literal translation; I want to make some...
4
by: Randall Hopper | last post by:
What is the correct way to propagate exceptions from Python callbacks? When I do this: Python -> C++ -> Python Callback (example attached) an exception raised in the callback doesn't make it...
53
by: Stelios Xanthakis | last post by:
Hi. pyvm is a program which can run python 2.4 bytecode (the .pyc files). A demo pre-release is available at: http://students.ceid.upatras.gr/~sxanth/pyvm/ Facts about pyvm: - It's FAST....
54
by: Vincent | last post by:
I would like to have my website translated in several languages and take advantage of language negotiation to let the user choose its preferred version of the site. I read with most interest the...
5
by: Krish | last post by:
Hello People I hope I am On Topic. Anyways, here is my problem. Any insights would be really appreciated. I have wrapped a C IO module using SWIG -> Python Module. Suppose the name of the...
8
by: NaeRey | last post by:
Hey, I've been searching for something like a PyOpenGL implementation that allows Python to use OpenGL, found only a few projects and most are either in beta and dead, or alpha stage. Anyone knows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.