2024-06-11 04:44:32 发布
网友
import tempfile print(help(tempfile.TemporaryFile)) print(help(tempfile.NamedTemporaryFile))
以上两个语句给出的结果与输出相同,它们是否属于同一个名为dtemporaryfile的类
同样,在上面的代码中,这两个类期望相同的命名/关键字参数在Python>;3中是相同的吗???在
那要看你的平台了。当我读https://github.com/python/cpython/blob/eb126eddbd7542ac9d7cd2736116aee2e0bd03dd/Lib/tempfile.py#L560中的代码时
if _os.name != 'posix' or _os.sys.platform == 'cygwin': # On non-POSIX and Cygwin systems, assume that we cannot unlink a file # while it is open. TemporaryFile = NamedTemporaryFile
对于非posix(linux等)环境或cygwin,这些方法是相同的。在
那要看你的平台了。当我读https://github.com/python/cpython/blob/eb126eddbd7542ac9d7cd2736116aee2e0bd03dd/Lib/tempfile.py#L560中的代码时
对于非posix(linux等)环境或cygwin,这些方法是相同的。在
相关问题 更多 >
编程相关推荐