Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80194

Re: Python extension using a C library with one 'hello' function

Date 2014-11-04 13:11 +0100
From Søren <sd@syntonetic.com>
Subject Re: Python extension using a C library with one 'hello' function
References <m3ab5o$kuo$1@dont-email.me> <5458C1DF.9010802@syntonetic.com>
Newsgroups comp.lang.python
Message-ID <mailman.15453.1415115015.18130.python-list@python.org> (permalink)

Show all headers | View raw


I'm not sure if it fits your needs, but we are very happy with calling c 
libs directly from python using ctypes:

https://docs.python.org/2/library/ctypes.html
It requires a few extra lines in Python to handle the parameter and 
return types.

import ctypes
result = ctypes.windll.Hello.hello()

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Python extension using a C library with one 'hello' function Veek M <vek.m1234@gmail.com> - 2014-11-04 16:22 +0630
  Re: Python extension using a C library with one 'hello' function Chris Angelico <rosuav@gmail.com> - 2014-11-05 01:57 +1100
  Re: Python extension using a C library with one 'hello' function Søren <sd@syntonetic.com> - 2014-11-04 13:11 +0100
    Re: Python extension using a C library with one 'hello' function Veek M <vek.m1234@gmail.com> - 2014-11-04 21:46 +0630
  Re: Python extension using a C library with one 'hello' function Jason Swails <jason.swails@gmail.com> - 2014-11-04 10:30 -0500
    Re: Python extension using a C library with one 'hello' function Veek M <vek.m1234@gmail.com> - 2014-11-04 21:45 +0630
      Re: Python extension using a C library with one 'hello' function Jason Swails <jason.swails@gmail.com> - 2014-11-04 11:28 -0500
        Re: Python extension using a C library with one 'hello' function Veek M <vek.m1234@gmail.com> - 2014-11-04 22:13 +0630
        Re: Python extension using a C library with one 'hello' function Veek M <vek.m1234@gmail.com> - 2014-11-04 22:39 +0630
          Re: Python extension using a C library with one 'hello' function Jason Swails <jason.swails@gmail.com> - 2014-11-04 12:28 -0500
    Re: Python extension using a C library with one 'hello' function Veek M <vek.m1234@gmail.com> - 2014-11-04 23:03 +0630
      Re: Python extension using a C library with one 'hello' function Jason Swails <jason.swails@gmail.com> - 2014-11-04 13:28 -0500

csiph-web