Re: to view output?
Cun Zhang <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
from ctypes import *
hello_lib = cdll.LoadLibrary("hello.so")
hello = hello_lib.hello
CHAR=(c_char)('a')
hello(CHAR)
On Fri, Apr 9, 2010 at 1:46 PM, anjali nair <[email protected]> wrote:
>
> Hi Folks,
>
> I am new to ctype.
>
> I tried a very simple wrapping of C using Python. The python version that I
> am using is Python 2.4.3. I installed ctype 1.0.2 .
>
> The c file hello.c is as follows:
> #include<stdio.h>
> void hello(char what)
> {
> printf("hllo");
> }
>
> int main()
> {
> hello('a');
> return 0;
> }
>
> my setup.py
>
> from ctypes import cdll
> hello_lib = cdll.LoadLibrary("hello.so")
> hello = hello_lib.hello
>
> I did a gcc -o hello.so -shared -fPIC hello.c
>
> How will I view the output now?
>
>
> Thanks in advance
>
> --
> Anjali M
> Student
> PSG College of Technology
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> ctypes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ctypes-users
>
>
--
Blog: http://www.edwardpku.com/cun
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev