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'

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

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

4

1 回答 1

1

2016 年提交以来,现已记录在案

可用性:Unix。

于 2021-01-29T23:12:37.727 回答