Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
import ctypes
|
||||
|
||||
user32_dll = ctypes.cdll.LoadLibrary('User32.dll')
|
||||
print user32_dll.GetDoubleClickTime()
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
>>> import ctypes
|
||||
>>> # libc = ctypes.cdll.msvcrt # Windows
|
||||
>>> # libc = ctypes.CDLL('libc.dylib') # Mac
|
||||
>>> libc = ctypes.CDLL('libc.so') # Linux and most other *nix
|
||||
>>> libc.printf(b'hi there, %s\n', b'world')
|
||||
hi there, world.
|
||||
17
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
>>> from cffi import FFI
|
||||
>>> ffi = FFI()
|
||||
>>> ffi.cdef("""
|
||||
... int printf(const char *format, ...); // copy-pasted from the man page
|
||||
... """)
|
||||
>>> C = ffi.dlopen(None) # loads the entire C namespace
|
||||
>>> arg = ffi.new("char[]", b"world") # equivalent to C code: char arg[] = "world";
|
||||
>>> C.printf(b"hi there, %s.\n", arg) # call printf
|
||||
hi there, world.
|
||||
17
|
||||
Loading…
Add table
Add a link
Reference in a new issue