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?
Asked
Active
Viewed 664 times
1 Answers
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
-
1Windows ships with msvcrt.dll, that's the best option – David Heffernan Oct 28 '11 at 12:07