【问题标题】:using os without having to reset shell无需重置外壳即可使用操作系统
【发布时间】:2015-12-10 22:55:36
【问题描述】:

我一直在尝试通过 Python 在 Windows 中使用 powershell promot,但是当我输入时:

import os
os.system("powershell")
os.system("ls")

...它重置其promots。如您所知, cmd 不接受 ls 命令。我正在寻找使终端在每个命令后不会自行重置的方法。

【问题讨论】:

  • 你想在我被 Python 惊呆的 powershell 中运行 ls 吗?

标签: python-3.x operating-system


【解决方案1】:

powershellinteractive 命令,它会阻止您的 Python 代码。也许一种powershell -c 'ls' 就足够了?

【讨论】:

    猜你喜欢
    • 2012-09-09
    • 1970-01-01
    • 1970-01-01
    • 2020-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-18
    相关资源
    最近更新 更多