10

Is there a portable way to load the C standard library (libc.so, libc.dylib) in Python ctypes? Should I just use if/elif statements about the result of platform.system() function?

minhee
  • 5,688
  • 5
  • 43
  • 81

1 Answers1

1

The ctypes library doesn't offer anything of that nature so an if statement is just what you need.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • @eryksun: As the documentation notes, the exact behaviour is platform dependent - on windows, "a call like `find_library("c")` will fail and return None". –  Oct 28 '11 at 11:51
  • 1
    Windows ships with msvcrt.dll, that's the best option – David Heffernan Oct 28 '11 at 12:07