“Python/docs/3.9/library/allos”的版本间差异

来自菜鸟教程
Python/docs/3.9/library/allos
跳转至:导航、​搜索
(autoload)
 
(Page commit)
 
第1行: 第1行:
 +
{{DISPLAYTITLE:通用操作系统服务 — Python 文档}}
 
<div id="generic-operating-system-services" class="section">
 
<div id="generic-operating-system-services" class="section">
  
 
<span id="allos"></span>
 
<span id="allos"></span>
= Generic Operating System Services =
+
= 通用操作系统服务 =
  
The modules described in this chapter provide interfaces to operating system
+
本章中描述的模块提供了与(几乎)所有操作系统上都可用的操作系统功能的接口,例如文件和时钟。 这些接口通常以 Unix C 接口为模型,但它们也可用于大多数其他系统。 这是一个概述:
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:
 
  
 
<div class="toctree-wrapper compound">
 
<div class="toctree-wrapper compound">
  
* [[../os|<code>os</code> --- Miscellaneous operating system interfaces]]
+
* [[../os|<code>os</code> — 其他操作系统接口]]
** [[../os#file-names-command-line-arguments-and-environment-variables|File Names, Command Line Arguments, and Environment Variables]]
+
** [[../os#file-names-command-line-arguments-and-environment-variables|文件名、命令行参数和环境变量]]
** [[../os#process-parameters|Process Parameters]]
+
** [[../os#process-parameters|工艺参数]]
** [[../os#file-object-creation|File Object Creation]]
+
** [[../os#file-object-creation|文件对象创建]]
** [[../os#file-descriptor-operations|File Descriptor Operations]]
+
** [[../os#file-descriptor-operations|文件描述符操作]]
*** [[../os#querying-the-size-of-a-terminal|Querying the size of a terminal]]
+
*** [[../os#querying-the-size-of-a-terminal|查询终端大小]]
*** [[../os#inheritance-of-file-descriptors|Inheritance of File Descriptors]]
+
*** [[../os#inheritance-of-file-descriptors|文件描述符的继承]]
** [[../os#files-and-directories|Files and Directories]]
+
** [[../os#files-and-directories|文件和目录]]
*** [[../os#linux-extended-attributes|Linux extended attributes]]
+
*** [[../os#linux-extended-attributes|Linux 扩展属性]]
** [[../os#process-management|Process Management]]
+
** [[../os#process-management|流程管理]]
** [[../os#interface-to-the-scheduler|Interface to the scheduler]]
+
** [[../os#interface-to-the-scheduler|调度器接口]]
** [[../os#miscellaneous-system-information|Miscellaneous System Information]]
+
** [[../os#miscellaneous-system-information|其他系统信息]]
** [[../os#random-numbers|Random numbers]]
+
** [[../os#random-numbers|随机数]]
* [[../io|<code>io</code> --- Core tools for working with streams]]
+
* [[../io|<code>io</code> — 处理流的核心工具]]
** [[../io#overview|Overview]]
+
** [[../io#overview|概述]]
*** [[../io#text-i-o|Text I/O]]
+
*** [[../io#text-i-o|文本输入/输出]]
*** [[../io#binary-i-o|Binary I/O]]
+
*** [[../io#binary-i-o|二进制输入/输出]]
*** [[../io#raw-i-o|Raw I/O]]
+
*** [[../io#raw-i-o|原始输入/输出]]
** [[../io#high-level-module-interface|High-level Module Interface]]
+
** [[../io#high-level-module-interface|高级模块接口]]
*** [[../io#in-memory-streams|In-memory streams]]
+
** [[../io#class-hierarchy|类层次结构]]
** [[../io#class-hierarchy|Class hierarchy]]
+
*** [[../io#i-o-base-classes|I/O 基类]]
*** [[../io#i-o-base-classes|I/O Base Classes]]
+
*** [[../io#raw-file-i-o|原始文件 I/O]]
*** [[../io#raw-file-i-o|Raw File I/O]]
+
*** [[../io#buffered-streams|缓冲流]]
*** [[../io#buffered-streams|Buffered Streams]]
+
*** [[../io#id3|文本输入/输出]]
*** [[../io#id1|Text I/O]]
+
** [[../io#performance|表现]]
** [[../io#performance|Performance]]
+
*** [[../io#id4|二进制输入/输出]]
*** [[../io#id2|Binary I/O]]
+
*** [[../io#id5|文本输入/输出]]
*** [[../io#id3|Text I/O]]
+
*** [[../io#multi-threading|多线程]]
*** [[../io#multi-threading|Multi-threading]]
+
*** [[../io#reentrancy|重入性]]
*** [[../io#reentrancy|Reentrancy]]
+
* [[../time|<code>time</code> — 时间访问和转换]]
* [[../time|<code>time</code> --- Time access and conversions]]
+
** [[../time#functions|职能]]
** [[../time#functions|Functions]]
+
** [[../time#clock-id-constants|时钟 ID 常量]]
** [[../time#clock-id-constants|Clock ID Constants]]
+
** [[../time#timezone-constants|时区常量]]
** [[../time#timezone-constants|Timezone Constants]]
+
* [[../argparse|<code>argparse</code> — 命令行选项、参数和子命令的解析器]]
* [[../argparse|<code>argparse</code> --- Parser for command-line options, arguments and sub-commands]]
+
** [[../argparse#example|例子]]
** [[../argparse#example|Example]]
+
*** [[../argparse#creating-a-parser|创建解析器]]
*** [[../argparse#creating-a-parser|Creating a parser]]
+
*** [[../argparse#adding-arguments|添加参数]]
*** [[../argparse#adding-arguments|Adding arguments]]
+
*** [[../argparse#parsing-arguments|解析参数]]
*** [[../argparse#parsing-arguments|Parsing arguments]]
+
** [[../argparse#argumentparser-objects|ArgumentParser 对象]]
** [[../argparse#argumentparser-objects|ArgumentParser objects]]
+
*** [[../argparse#prog|]]
*** [[../argparse#prog|prog]]
+
*** [[../argparse#usage|用法]]
*** [[../argparse#usage|usage]]
+
*** [[../argparse#description|描述]]
*** [[../argparse#description|description]]
+
*** [[../argparse#epilog|结语]]
*** [[../argparse#epilog|epilog]]
+
*** [[../argparse#parents|父母]]
*** [[../argparse#parents|parents]]
+
*** [[../argparse#formatter-class|格式化程序类]]
*** [[../argparse#formatter-class|formatter_class]]
+
*** [[../argparse#prefix-chars|前缀字符]]
*** [[../argparse#prefix-chars|prefix_chars]]
 
 
*** [[../argparse#fromfile-prefix-chars|fromfile_prefix_chars]]
 
*** [[../argparse#fromfile-prefix-chars|fromfile_prefix_chars]]
*** [[../argparse#argument-default|argument_default]]
+
*** [[../argparse#argument-default|参数_默认值]]
 
*** [[../argparse#allow-abbrev|allow_abbrev]]
 
*** [[../argparse#allow-abbrev|allow_abbrev]]
*** [[../argparse#conflict-handler|conflict_handler]]
+
*** [[../argparse#conflict-handler|冲突处理程序]]
*** [[../argparse#add-help|add_help]]
+
*** [[../argparse#add-help|添加帮助]]
 
*** [[../argparse#exit-on-error|exit_on_error]]
 
*** [[../argparse#exit-on-error|exit_on_error]]
** [[../argparse#the-add-argument-method|The add_argument() method]]
+
** [[../argparse#the-add-argument-method|add_argument() 方法]]
*** [[../argparse#name-or-flags|name or flags]]
+
*** [[../argparse#name-or-flags|名称或标志]]
*** [[../argparse#action|action]]
+
*** [[../argparse#action|行动]]
 
*** [[../argparse#nargs|nargs]]
 
*** [[../argparse#nargs|nargs]]
*** [[../argparse#const|const]]
+
*** [[../argparse#const|常量]]
*** [[../argparse#default|default]]
+
*** [[../argparse#default|默认]]
*** [[../argparse#type|type]]
+
*** [[../argparse#type|类型]]
*** [[../argparse#choices|choices]]
+
*** [[../argparse#choices|选择]]
*** [[../argparse#required|required]]
+
*** [[../argparse#required|必需的]]
*** [[../argparse#help|help]]
+
*** [[../argparse#help|帮助]]
*** [[../argparse#metavar|metavar]]
+
*** [[../argparse#metavar|元变量]]
*** [[../argparse#dest|dest]]
+
*** [[../argparse#dest|目的地]]
*** [[../argparse#action-classes|Action classes]]
+
*** [[../argparse#action-classes|动作类]]
** [[../argparse#the-parse-args-method|The parse_args() method]]
+
** [[../argparse#the-parse-args-method|parse_args() 方法]]
*** [[../argparse#option-value-syntax|Option value syntax]]
+
*** [[../argparse#option-value-syntax|选项值语法]]
*** [[../argparse#invalid-arguments|Invalid arguments]]
+
*** [[../argparse#invalid-arguments|无效参数]]
*** [[../argparse#arguments-containing|Arguments containing <code>-</code>]]
+
*** [[../argparse#arguments-containing|包含 <code>-</code> 的参数]]
*** [[../argparse#argument-abbreviations-prefix-matching|Argument abbreviations (prefix matching)]]
+
*** [[../argparse#argument-abbreviations-prefix-matching|参数缩写(前缀匹配)]]
*** [[../argparse#beyond-sys-argv|Beyond <code>sys.argv</code>]]
+
*** [[../argparse#beyond-sys-argv|超越<code>sys.argv</code>]]
*** [[../argparse#the-namespace-object|The Namespace object]]
+
*** [[../argparse#the-namespace-object|命名空间对象]]
** [[../argparse#other-utilities|Other utilities]]
+
** [[../argparse#other-utilities|其他公用事业]]
*** [[../argparse#sub-commands|Sub-commands]]
+
*** [[../argparse#sub-commands|子命令]]
*** [[../argparse#filetype-objects|FileType objects]]
+
*** [[../argparse#filetype-objects|文件类型对象]]
*** [[../argparse#argument-groups|Argument groups]]
+
*** [[../argparse#argument-groups|参数组]]
*** [[../argparse#mutual-exclusion|Mutual exclusion]]
+
*** [[../argparse#mutual-exclusion|相互排斥]]
*** [[../argparse#parser-defaults|Parser defaults]]
+
*** [[../argparse#parser-defaults|解析器默认值]]
*** [[../argparse#printing-help|Printing help]]
+
*** [[../argparse#printing-help|打印帮助]]
*** [[../argparse#partial-parsing|Partial parsing]]
+
*** [[../argparse#partial-parsing|部分解析]]
*** [[../argparse#customizing-file-parsing|Customizing file parsing]]
+
*** [[../argparse#customizing-file-parsing|自定义文件解析]]
*** [[../argparse#exiting-methods|Exiting methods]]
+
*** [[../argparse#exiting-methods|退出方法]]
*** [[../argparse#intermixed-parsing|Intermixed parsing]]
+
*** [[../argparse#intermixed-parsing|混合解析]]
** [[../argparse#upgrading-optparse-code|Upgrading optparse code]]
+
** [[../argparse#upgrading-optparse-code|升级 optparse 代码]]
* [[../getopt|<code>getopt</code> --- C-style parser for command line options]]
+
* [[../getopt|<code>getopt</code> — 命令行选项的 C 风格解析器]]
* [[../logging|<code>logging</code> --- Logging facility for Python]]
+
* [[../logging|<code>logging</code> Python 的日志记录工具]]
** [[../logging#logger-objects|Logger Objects]]
+
** [[../logging#logger-objects|记录器对象]]
** [[../logging#logging-levels|Logging Levels]]
+
** [[../logging#logging-levels|日志级别]]
** [[../logging#handler-objects|Handler Objects]]
+
** [[../logging#handler-objects|处理程序对象]]
** [[../logging#formatter-objects|Formatter Objects]]
+
** [[../logging#formatter-objects|格式化程序对象]]
** [[../logging#filter-objects|Filter Objects]]
+
** [[../logging#filter-objects|过滤对象]]
** [[../logging#logrecord-objects|LogRecord Objects]]
+
** [[../logging#logrecord-objects|日志记录对象]]
** [[../logging#logrecord-attributes|LogRecord attributes]]
+
** [[../logging#logrecord-attributes|日志记录属性]]
** [[../logging#loggeradapter-objects|LoggerAdapter Objects]]
+
** [[../logging#loggeradapter-objects|记录器适配器对象]]
** [[../logging#thread-safety|Thread Safety]]
+
** [[../logging#thread-safety|线程安全]]
** [[../logging#module-level-functions|Module-Level Functions]]
+
** [[../logging#module-level-functions|模块级函数]]
** [[../logging#module-level-attributes|Module-Level Attributes]]
+
** [[../logging#module-level-attributes|模块级属性]]
** [[../logging#integration-with-the-warnings-module|Integration with the warnings module]]
+
** [[../logging#integration-with-the-warnings-module|与警告模块集成]]
* [[../logging.config|<code>logging.config</code> --- Logging configuration]]
+
* [[../logging.config|<code>logging.config</code> — 日志配置]]
** [[../logging|Configuration functions]]
+
** [[../logging|配置功能]]
** [[../logging|Configuration dictionary schema]]
+
** [[../logging|配置字典架构]]
*** [[../logging|Dictionary Schema Details]]
+
*** [[../logging|字典架构详细信息]]
*** [[../logging|Incremental Configuration]]
+
*** [[../logging|增量配置]]
*** [[../logging|Object connections]]
+
*** [[../logging|对象连接]]
*** [[../logging|User-defined objects]]
+
*** [[../logging|用户定义对象]]
*** [[../logging|Access to external objects]]
+
*** [[../logging|访问外部对象]]
*** [[../logging|Access to internal objects]]
+
*** [[../logging|访问内部对象]]
*** [[../logging|Import resolution and custom importers]]
+
*** [[../logging|导入分辨率和自定义导入器]]
** [[../logging|Configuration file format]]
+
** [[../logging|配置文件格式]]
* [[../logging.handlers|<code>logging.handlers</code> --- Logging handlers]]
+
* [[../logging.handlers|<code>logging.handlers</code> — 日志处理程序]]
** [[../logging|StreamHandler]]
+
** [[../logging|流处理器]]
** [[../logging|FileHandler]]
+
** [[../logging|文件处理器]]
** [[../logging|NullHandler]]
+
** [[../logging|空处理器]]
** [[../logging|WatchedFileHandler]]
+
** [[../logging|监视文件处理程序]]
 
** [[../logging|BaseRotatingHandler]]
 
** [[../logging|BaseRotatingHandler]]
** [[../logging|RotatingFileHandler]]
+
** [[../logging|旋转文件处理器]]
** [[../logging|TimedRotatingFileHandler]]
+
** [[../logging|定时旋转文件处理器]]
** [[../logging|SocketHandler]]
+
** [[../logging|套接字处理程序]]
** [[../logging|DatagramHandler]]
+
** [[../logging|数据报处理器]]
** [[../logging|SysLogHandler]]
+
** [[../logging|系统日志处理程序]]
 
** [[../logging|NTEventLogHandler]]
 
** [[../logging|NTEventLogHandler]]
** [[../logging|SMTPHandler]]
+
** [[../logging|SMTP处理程序]]
** [[../logging|MemoryHandler]]
+
** [[../logging|内存处理器]]
** [[../logging|HTTPHandler]]
+
** [[../logging|HTTP处理程序]]
** [[../logging|QueueHandler]]
+
** [[../logging|队列处理器]]
** [[../logging|QueueListener]]
+
** [[../logging|队列监听器]]
* [[../getpass|<code>getpass</code> --- Portable password input]]
+
* [[../getpass|<code>getpass</code> — 便携式密码输入]]
* [[../curses|<code>curses</code> --- Terminal handling for character-cell displays]]
+
* [[../curses|<code>curses</code> — 字符单元显示的终端处理]]
** [[../curses#functions|Functions]]
+
** [[../curses#functions|职能]]
** [[../curses#window-objects|Window Objects]]
+
** [[../curses#window-objects|窗口对象]]
** [[../curses#constants|Constants]]
+
** [[../curses#constants|常数]]
* [[../curses#module-curses|<code>curses.textpad</code> --- Text input widget for curses programs]]
+
* [[../curses#module-curses|<code>curses.textpad</code> — 诅咒程序的文本输入小部件]]
** [[../curses#textbox-objects|Textbox objects]]
+
** [[../curses#textbox-objects|文本框对象]]
* [[../curses.ascii|<code>curses.ascii</code> --- Utilities for ASCII characters]]
+
* [[../curses.ascii|<code>curses.ascii</code> ASCII 字符的实用程序]]
* [[../curses.panel|<code>curses.panel</code> --- A panel stack extension for curses]]
+
* [[../curses.panel|<code>curses.panel</code> — 诅咒的面板集扩展]]
** [[../curses|Functions]]
+
** [[../curses|职能]]
** [[../curses|Panel Objects]]
+
** [[../curses|面板对象]]
* [[../platform|<code>platform</code> --- Access to underlying platform's identifying data]]
+
* [[../platform|<code>platform</code> — 访问底层平台的识别数据]]
** [[../platform#cross-platform|Cross Platform]]
+
** [[../platform#cross-platform|跨平台]]
** [[../platform#java-platform|Java Platform]]
+
** [[../platform#java-platform|Java平台]]
** [[../platform#windows-platform|Windows Platform]]
+
** [[../platform#windows-platform|视窗平台]]
** [[../platform#mac-os-platform|Mac OS Platform]]
+
** [[../platform#macos-platform|macOS 平台]]
** [[../platform#unix-platforms|Unix Platforms]]
+
** [[../platform#unix-platforms|Unix平台]]
* [[../errno|<code>errno</code> --- Standard errno system symbols]]
+
* [[../errno|<code>errno</code> — 标准 errno 系统符号]]
* [[../ctypes|<code>ctypes</code> --- A foreign function library for Python]]
+
* [[../ctypes|<code>ctypes</code> Python 的外部函数库]]
** [[../ctypes#ctypes-tutorial|ctypes tutorial]]
+
** [[../ctypes#ctypes-tutorial|ctypes教程]]
*** [[../ctypes#loading-dynamic-link-libraries|Loading dynamic link libraries]]
+
*** [[../ctypes#loading-dynamic-link-libraries|加载动态链接库]]
*** [[../ctypes#accessing-functions-from-loaded-dlls|Accessing functions from loaded dlls]]
+
*** [[../ctypes#accessing-functions-from-loaded-dlls|从加载的 dll 访问函数]]
*** [[../ctypes#calling-functions|Calling functions]]
+
*** [[../ctypes#calling-functions|调用函数]]
*** [[../ctypes#fundamental-data-types|Fundamental data types]]
+
*** [[../ctypes#fundamental-data-types|基本数据类型]]
*** [[../ctypes#calling-functions-continued|Calling functions, continued]]
+
*** [[../ctypes#calling-functions-continued|调用函数,续]]
*** [[../ctypes#calling-functions-with-your-own-custom-data-types|Calling functions with your own custom data types]]
+
*** [[../ctypes#calling-functions-with-your-own-custom-data-types|使用您自己的自定义数据类型调用函数]]
*** [[../ctypes#specifying-the-required-argument-types-function-prototypes|Specifying the required argument types (function prototypes)]]
+
*** [[../ctypes#specifying-the-required-argument-types-function-prototypes|指定所需的参数类型(函数原型)]]
*** [[../ctypes#return-types|Return types]]
+
*** [[../ctypes#return-types|返回类型]]
*** [[ctypes.html#passing-pointers-or-passing-parameters-by-reference|Passing pointers (or: passing parameters by reference)]]
+
*** [[../ctypes#passing-pointers-or-passing-parameters-by-reference|传递指针(或:通过引用传递参数)]]
*** [[../ctypes#structures-and-unions|Structures and unions]]
+
*** [[../ctypes#structures-and-unions|结构和工会]]
*** [[../ctypes#structure-union-alignment-and-byte-order|Structure/union alignment and byte order]]
+
*** [[../ctypes#structure-union-alignment-and-byte-order|结构/联合对齐和字节顺序]]
*** [[../ctypes#bit-fields-in-structures-and-unions|Bit fields in structures and unions]]
+
*** [[../ctypes#bit-fields-in-structures-and-unions|结构体和联合体中的位域]]
*** [[../ctypes#arrays|Arrays]]
+
*** [[../ctypes#arrays|数组]]
*** [[../ctypes#pointers|Pointers]]
+
*** [[../ctypes#pointers|指针]]
*** [[../ctypes#type-conversions|Type conversions]]
+
*** [[../ctypes#type-conversions|类型转换]]
*** [[../ctypes#incomplete-types|Incomplete Types]]
+
*** [[../ctypes#incomplete-types|不完全类型]]
*** [[../ctypes#callback-functions|Callback functions]]
+
*** [[../ctypes#callback-functions|回调函数]]
*** [[../ctypes#accessing-values-exported-from-dlls|Accessing values exported from dlls]]
+
*** [[../ctypes#accessing-values-exported-from-dlls|访问从 dll 导出的值]]
*** [[../ctypes#surprises|Surprises]]
+
*** [[../ctypes#surprises|惊喜]]
*** [[../ctypes#variable-sized-data-types|Variable-sized data types]]
+
*** [[../ctypes#variable-sized-data-types|可变大小的数据类型]]
** [[../ctypes#ctypes-reference|ctypes reference]]
+
** [[../ctypes#ctypes-reference|ctypes 参考]]
*** [[../ctypes#finding-shared-libraries|Finding shared libraries]]
+
*** [[../ctypes#finding-shared-libraries|查找共享库]]
*** [[../ctypes#loading-shared-libraries|Loading shared libraries]]
+
*** [[../ctypes#loading-shared-libraries|加载共享库]]
*** [[../ctypes#foreign-functions|Foreign functions]]
+
*** [[../ctypes#foreign-functions|外部函数]]
*** [[../ctypes#function-prototypes|Function prototypes]]
+
*** [[../ctypes#function-prototypes|函数原型]]
*** [[../ctypes#utility-functions|Utility functions]]
+
*** [[../ctypes#utility-functions|实用功能]]
*** [[../ctypes#data-types|Data types]]
+
*** [[../ctypes#data-types|数据类型]]
*** [[../ctypes#ctypes-fundamental-data-types-2|Fundamental data types]]
+
*** [[../ctypes#ctypes-fundamental-data-types-2|基本数据类型]]
*** [[../ctypes#structured-data-types|Structured data types]]
+
*** [[../ctypes#structured-data-types|结构化数据类型]]
*** [[../ctypes#arrays-and-pointers|Arrays and pointers]]
+
*** [[../ctypes#arrays-and-pointers|数组和指针]]
  
  
第193行: 第190行:
  
 
</div>
 
</div>
 +
<div class="clearer">
  
[[Category:Python 3.9 中文文档]]
+
 
 +
 
 +
</div>
 +
 
 +
[[Category:Python 3.9 文档]]

2021年10月31日 (日) 04:51的最新版本

通用操作系统服务

本章中描述的模块提供了与(几乎)所有操作系统上都可用的操作系统功能的接口,例如文件和时钟。 这些接口通常以 Unix 或 C 接口为模型,但它们也可用于大多数其他系统。 这是一个概述: