Ctypes

775 views
680 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
775
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ctypes

  1. 1. a foreign function library for Python 交大資工系103級 戴嘉駿/darkgerm <darkgerm@gmail.com>
  2. 2. How can Python combine withC? Python API Python built-in module - ctypes third party module (ex: boost.python, SWIG)
  3. 3. What is ctypes A foreign function library for Python. It provides C compatible data types. It allows calling functions in DLLs or shared libraries.
  4. 4. ctypes History 1
  5. 5. Reasons to use ctypes more portable between implementations of Python. It has a much lower startup cost. It is in Python Standard Library. youre still writing Python!
  6. 6. Fundamenta data types
  7. 7. Structures and Unions
  8. 8. Example on stackoverflow
  9. 9. Example on stackoverflow
  10. 10. Example on stackoverflow
  11. 11. Example on stackoverflow
  12. 12. Example on stackoverflow
  13. 13. Example on stackoverflow
  14. 14. Example on stackoverflow
  15. 15. Modify the Example
  16. 16. Modify the Example
  17. 17. Modify the Example
  18. 18. Modify the Example
  19. 19. function prototypes
  20. 20. function prototypes
  21. 21. Who use ctypes?
  22. 22. Who use ctypes?
  23. 23. Who use ctypes?
  24. 24. Thank you for listening!!Ref: http://docs.python.org/library/ctypes.html http://stackoverflow.com/questions/145270/calling-c-c-from-python http://stackoverflow.com/questions/135834/python-swig-vs-ctypes http://stackoverflow.com/questions/1942298/wrapping-a-c-library-in- python-c-cython-or-ctypes https://www.google.com/

×