Calling foreign functions from Python? ctypes?
Carl Friedrich Bolz
cfbolz at gmx.de
Sat Jan 7 09:36:27 EST 2006
Jean-Paul Calderone wrote:
>
> I could probably dig up a few more, if you want. So what's ctypes on top of this?
>
another one:
cfbolz at gauss:~$ python
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import weakref
>>> ref = None
>>> class Target:
... def __del__(self):
... global ref
... ref = weakref.ref(self)
...
>>> def g():
... w = Target()
... w = None
... print ref()
...
>>> g()
Segmentation fault
There are dozends of segfaults in Python indeed.
Cheers,
Carl Friedrich Bolz
More information about the Python-list
mailing list