Easiest way to access C module in Python

Gisle Vanem gisle.vanem at gmail.com
Tue Nov 7 16:27:08 EST 2017


bartc wrote:

>>  From inside python 2.7:
>>    Python 2.7.13rc1 (v2.7.13rc1:4d6fd49eeb14, Dec  3 2016, 21:49:42) [MSC v.1500 32 bit (Intel)] on win32
>>    Type "help", "copyright", "credits" or "license" for more information.
>>    >>> import life
>>    >>> dir(life)
>>    ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__test__']
>>    >>>
>>
>> works fine.
> 
> Not really, as it's missing the attribute 'life' which is needed for the second part of 'life.life':

Not sure what happend there. All is working now. But as
you stated, Cython is truly a "beast".

But as I wrote to Lele privately, the main reason for the failure,
was Cygwin's Python2.7 messing up. I invoked the build from a GNU-Makefile.
Thus Cygwin's Python was picked up from /bin/bash instead of my regular
Python on PATH. A real PITA.

-- 
--gv



More information about the Python-list mailing list