Update of /cvsroot/ctypes/ctypes/docs/manual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1734
Modified Files:
tutorial.txt
Log Message:
Add some notes.
Index: tutorial.txt
===================================================================
RCS file: /cvsroot/ctypes/ctypes/docs/manual/tutorial.txt,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** tutorial.txt 19 Apr 2006 18:14:39 -0000 1.19
--- tutorial.txt 19 Apr 2006 18:35:30 -0000 1.20
***************
*** 5,10 ****
This tutorial describes version 0.9.9 of ``ctypes``.
! Since older versions are quite common, I'll mention major differences
! when needed.
Loading dynamic link libraries
--- 5,18 ----
This tutorial describes version 0.9.9 of ``ctypes``.
!
! Note: The code samples in this tutorial uses ``doctest`` to make sure
! that they actually work. Since some code samples behave differently
! under Linux, Windows, or Mac OS X, they contain doctest directives in
! comments.
!
! Note: Quite some code samples references the ctypes ``c_int`` type.
! This type is an alias to the ``c_long`` type on 32-bit systems. So,
! you should not be confused if ``c_long`` is printed if you would
! expect ``c_int`` - they are actually the same type.
Loading dynamic link libraries
***************
*** 45,53 ****
>>> cdll.LoadLibrary("libc.so.6") # doctest: +LINUX
<CDLL 'libc.so.6', handle ... at ...>
! >>> libc = CDLL("libc.so.6")
! >>> libc
<CDLL 'libc.so.6', handle ... at ...>
>>>
Accessing functions from loaded dlls
--- 53,62 ----
>>> cdll.LoadLibrary("libc.so.6") # doctest: +LINUX
<CDLL 'libc.so.6', handle ... at ...>
! >>> libc = CDLL("libc.so.6") # doctest: +LINUX
! >>> libc # doctest: +LINUX
<CDLL 'libc.so.6', handle ... at ...>
>>>
+ XXX Add section for Mac OS X.
Accessing functions from loaded dlls
***************
*** 101,106 ****
>>> cdll.kernel32[1] # doctest: +WINDOWS
! <_FuncPtr object ar 0x...>
>>> cdll.kernel32[0] # doctest: +WINDOWS
>>>
--- 110,120 ----
>>> cdll.kernel32[1] # doctest: +WINDOWS
! <_FuncPtr object at 0x...>
>>> cdll.kernel32[0] # doctest: +WINDOWS
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in ?
+ File "ctypes.py", line 310, in __getitem__
+ func = _StdcallFuncPtr(name, self)
+ AttributeError: function ordinal 0 not found
>>>
|