通用作業系統服務¶
此章節所描述的模組 (module) 提供了作業系統特性的使用介面,例如檔案與時鐘,(幾乎)在所有作業系統上皆能使用。這些介面通常是參考 Unix 或 C 的介面來實作,不過在其他大多數系統上也能使用。以下為概述:
os--- 各種作業系統介面io— 處理資料串流的核心工具time--- Time access and conversionsargparse--- Parser for command-line options, arguments and sub-commandsgetopt--- C-style parser for command line optionslogging--- Logging facility for Pythonlogging.config--- Logging configurationlogging.handlers--- Logging handlersgetpass--- 可攜式密碼輸入工具curses--- Terminal handling for character-cell displayscurses.textpad--- Text input widget for curses programscurses.ascii--- ASCII 字元的工具程式curses.panel--- A panel stack extension for cursesplatform--- 獲取底層平臺的標識資料errno--- Standard errno system symbolsctypes--- A foreign function library for Python- ctypes tutorial
- Loading dynamic link libraries
- Accessing functions from loaded dlls
- Calling functions
- Fundamental data types
- Calling functions, continued
- Calling variadic functions
- Calling functions with your own custom data types
- Specifying the required argument types (function prototypes)
- Return types
- Passing pointers (or: passing parameters by reference)
- Structures and unions
- Structure/union alignment and byte order
- Bit fields in structures and unions
- Arrays
- Pointers
- Type conversions
- Incomplete Types
- Callback functions
- Accessing values exported from dlls
- Surprises
- Variable-sized data types
- ctypes reference
- ctypes tutorial