PowerShell的,为什么弹出窗口,如何阻止它(Powershell why popup win

2019-09-21 17:24发布

不知道为什么,当我执行像Python工具pipnosetests内PowerShell中,一个单独的弹出命令行窗口会显示,执行我的命令,然后就消失了。 这是烦人,因为我几乎看不到可执行输出,尤其是弹出收盘前的最后几行。

我认为有一些设置,我可以改变停止弹出?

我在Windows 7中使用PowerShell 2.0。

Answer 1:

PowerShell是不是cmd.exe的,它有一个不同的控制台界面。 更可能的,你的PY工具写入到一个不存在的shell窗口。 您可以通过以下语法来解决这个问题:

cmd /c script.py

当您直接从PS提示符下执行Python脚本,你要做的就是火,掀起了DOS外壳的一段时间内它花费的命令来完成。 由于没有“暂停”实施,外壳窗口的命令完成时关闭。

测试脚本

# tester.py, just a test
print "This is a test script, that is all."

输出PS:

C:\src\python
{powem} [36] --> .\tester.py
C:\src\python
{powem} [37] --> cmd /c .\tester.py
This is a test script, that is all.

熔点



Answer 2:

对于有人有类似的问题,请看看这个答案 ,我认为这个解决方案,最终解决我的问题。 在我而言,我不得不重新启动我的电脑把一切工作。



文章来源: Powershell why popup window, how to stop it