小编hon*_*oow的帖子

在 Windows Python 文件中使用 `touch`

我有一个在 macOS 上运行的 Python 文件,它通过以下方式调用 touch:

os.system("touch -c %s" % apicache_file)

os.system("touch -c %s" % downloadFilename)

os.system("touch -c %s" % meta_cache_file)
Run Code Online (Sandbox Code Playgroud)

但是,我需要在 Windows 机器上运行脚本。如何修改脚本或系统以允许执行此操作?否则,我会收到以下错误:

'touch' is not recognized as an internal or external command, operable program or batch file
Run Code Online (Sandbox Code Playgroud)

python unix windows

1
推荐指数
1
解决办法
364
查看次数

标签 统计

python ×1

unix ×1

windows ×1