How to run python interpreter in windows powershell ISE?

隐身守侯 提交于 2019-12-13 19:26:58

问题


According Microsoft, we can't run interactive console like python in it's own powershell ISE console. According to some sources it runs in the background. Can we run the same python interpreter in foreground?


回答1:


When people say it "runs in the background" they mean that when you try to run Python in ISE, it opens a legacy console app which ISE illogically hides (even though it can't bridge your actions to that app).

If you run a script which runs and terminates, that's fine, you can do that. You can, for instance, run python --version ...

But you can only start it interactively if you run it as a separate window using the start-process command: start python

Frankly, you'll have a lot better success interacting with PowerShell using the native console version of PowerShell.exe instead of ISE -- there, you can run python interactively and get the output into PowerShell without redirecting it through files.



来源:https://stackoverflow.com/questions/36994993/how-to-run-python-interpreter-in-windows-powershell-ise

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!