Pending removal in Python 3.16
-
Functions to configure Python's initialization, deprecated in Python 3.11:
!PySys_SetArgvEx(): SetPyConfig.argvinstead.!PySys_SetArgv(): SetPyConfig.argvinstead.!Py_SetProgramName(): SetPyConfig.program_nameinstead.!Py_SetPythonHome(): SetPyConfig.homeinstead.
The
Py_InitializeFromConfigAPI should be used withPyConfiginstead. -
Global configuration variables:
!Py_DebugFlag: UsePyConfig.parser_debugorPyConfig_Get("parser_debug") <PyConfig_Get>instead.!Py_VerboseFlag: UsePyConfig.verboseorPyConfig_Get("verbose") <PyConfig_Get>instead.!Py_QuietFlag: UsePyConfig.quietorPyConfig_Get("quiet") <PyConfig_Get>instead.!Py_InteractiveFlag: UsePyConfig.interactiveorPyConfig_Get("interactive") <PyConfig_Get>instead.!Py_InspectFlag: UsePyConfig.inspectorPyConfig_Get("inspect") <PyConfig_Get>instead.!Py_OptimizeFlag: UsePyConfig.optimization_levelorPyConfig_Get("optimization_level") <PyConfig_Get>instead.!Py_NoSiteFlag: UsePyConfig.site_importorPyConfig_Get("site_import") <PyConfig_Get>instead.!Py_BytesWarningFlag: UsePyConfig.bytes_warningorPyConfig_Get("bytes_warning") <PyConfig_Get>instead.!Py_FrozenFlag: UsePyConfig.pathconfig_warningsorPyConfig_Get("pathconfig_warnings") <PyConfig_Get>instead.!Py_IgnoreEnvironmentFlag: UsePyConfig.use_environmentorPyConfig_Get("use_environment") <PyConfig_Get>instead.!Py_DontWriteBytecodeFlag: UsePyConfig.write_bytecodeorPyConfig_Get("write_bytecode") <PyConfig_Get>instead.!Py_NoUserSiteDirectory: UsePyConfig.user_site_directoryorPyConfig_Get("user_site_directory") <PyConfig_Get>instead.!Py_UnbufferedStdioFlag: UsePyConfig.buffered_stdioorPyConfig_Get("buffered_stdio") <PyConfig_Get>instead.!Py_HashRandomizationFlag: UsePyConfig.use_hash_seedandPyConfig.hash_seedorPyConfig_Get("hash_seed") <PyConfig_Get>instead.!Py_IsolatedFlag: UsePyConfig.isolatedorPyConfig_Get("isolated") <PyConfig_Get>instead.!Py_LegacyWindowsFSEncodingFlag: UsePyPreConfig.legacy_windows_fs_encodingorPyConfig_Get("legacy_windows_fs_encoding") <PyConfig_Get>instead.!Py_LegacyWindowsStdioFlag: UsePyConfig.legacy_windows_stdioorPyConfig_Get("legacy_windows_stdio") <PyConfig_Get>instead.!Py_FileSystemDefaultEncoding,!Py_HasFileSystemDefaultEncoding: UsePyConfig.filesystem_encodingorPyConfig_Get("filesystem_encoding") <PyConfig_Get>instead.!Py_FileSystemDefaultEncodeErrors: UsePyConfig.filesystem_errorsorPyConfig_Get("filesystem_errors") <PyConfig_Get>instead.!Py_UTF8Mode: UsePyPreConfig.utf8_modeorPyConfig_Get("utf8_mode") <PyConfig_Get>instead. (seePy_PreInitialize)
The
Py_InitializeFromConfigAPI should be used withPyConfigto set these options. OrPyConfig_Getcan be used to get these options at runtime. -
Py_UNICODEwhich was deprecated by393.
这篇文档对你有帮助吗?
谢谢你的反馈!