如何执行程序或批处理文件?

How to execute program or batch file?

我已经安装 PyCharm 以在 [=27 上使用 Python 语言=] 10.

我正在尝试从 PyCharm 中的 Linux 命令执行命令,我使用了以下代码:

import subprocess
subprocess.run("cat",shell=True,text=True)

但是我得到这个错误:

'cat' is not recognized as an internal or external command, operable program or batch file.

我想再执行几个命令,例如这个例子,但是所有命令都会引发相同的错误。如何解决?

Cat is a binary included in Unix systems, since windows isn't based on Unix, it wouldn't work. You should rather try the TYPE 命令在 Windows