Generic Operating System Services通用操作系统服务¶
The modules described in this chapter provide interfaces to operating system features that are available on (almost) all operating systems, such as files and a clock. 本章描述的模块提供了操作系统功能的接口,这些功能在(几乎)所有操作系统上都可用,例如文件和时钟。The interfaces are generally modeled after the Unix or C interfaces, but they are available on most other systems as well. Here’s an overview:这些接口通常以Unix或C接口为模型,但在大多数其他系统上也可用。以下是概述:
os
—Miscellaneous operating system interfaces其他操作系统接口File Names, Command Line Arguments, and Environment Variables文件名、命令行参数和环境变量- Python UTF-8
Mode模式 Process Parameters工艺参数File Object Creation文件对象创建File Descriptor Operations文件描述符操作Files and Directories文件和目录Process Management流程管理Interface to the scheduler调度程序接口Miscellaneous System Information其他系统信息Random numbers随机数
io
—Core tools for working with streams用于处理流的核心工具time
—Time access and conversions时间访问和转换argparse
—Parser for command-line options, arguments and sub-commands命令行选项、参数和子命令的解析器getopt
—C-style parser for command line options用于命令行选项的C风格解析器logging
—Logging facility for PythonPython日志记录工具logging.config
—Logging configuration日志记录配置logging.handlers
—Logging handlers日志记录处理程序getpass
—Portable password input便携式密码输入curses
—Terminal handling for character-cell displays字符单元显示的终端处理curses.textpad
—Text input widget for curses programscurses程序的文本输入小部件curses.ascii
—Utilities for ASCII charactersASCII字符实用程序curses.panel
—A panel stack extension for curses用于诅咒的面板堆栈扩展platform
—Access to underlying platform’s identifying data访问底层平台的标识数据errno
—Standard errno system symbols标准errno系统符号ctypes
—A foreign function library for PythonPython的外部函数库- ctypes
tutorial辅导的Loading dynamic link libraries加载动态链接库Accessing functions from loaded dlls从加载的DLL访问函数Calling functions调用函数Fundamental data types基本数据类型Calling functions, continued调用函数,续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访问从DLL导出的值Surprises惊喜Variable-sized data types可变大小的数据类型
- ctypes
reference参考
- ctypes