问题
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