1. Python CFFI
  2. Untitled project
  3. cffi


cffi / demo / pwuid.py

The branch 'release-0.3' does not exist.
Armin Rigo 70864b4 

Armin Rigo 58f2cb2 
from cffi import FFI
ffi = FFI()
ffi.cdef("""     // some declarations from the man page
    struct passwd {
        char *pw_name;
    struct passwd *getpwuid(int uid);
C = ffi.verify("""   // passed to the real C compiler
#include <sys/types.h>
#include <pwd.h>
print ffi.string(C.getpwuid(0).pw_name)