Windows 中的 Python os.mknod

spa*_*c24 5 python windows windows-7 python-3.x python-3.5

我试图os.mknod在 Windows 7 的 Python 3.5.0 中使用该函数,但是我发现了错误:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    os.mknod
AttributeError: module 'os' has no attribute 'mknod'
Run Code Online (Sandbox Code Playgroud)

我想它应该在那里,因为https://docs.python.org/3/library/os.html没有说明可用性有限。在 Windows 中是否有其他选项可用于类似功能?我只是想在特定路径中创建一个空文件,我认为调用open(path, 'w')有点难看。

我不知道这是否是版本特定的问题,因为我以前从未在 Windows 中使用过 Python。

小智 1

2016 年提交以来,现已记录如下:

可用性:Unix。