发布网友 发布时间:2022-05-18 19:46
共1个回答
热心网友 时间:2023-10-27 23:39
你是用得ps ise吧,在那里面是有问题
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.
直接在ps里就没问题了