如何在不打开 CMD window 的情况下通过 subprocess.call() 运行 CMD 命令?

How to run CMD commands via subprocess.call() without opening CMD window?

我可以通过 Python 和 subprocess.call('insert command here') 通过 CMD 运行 命令,但它会打开 CMD window 然后立即关闭。有什么办法可以完全不打开吗?

调用subprocess.call时可以设置shell=True:

subprocess.call('insert command here', shell=True)