My Python 3 (3.6) opens new black console window for each Python command I run ( pip
is just the same).
Example: When I create a hello_world.py with a while True: print("hello world")
Loop in it and start it from PowerShell via python test.py
it will open a new window, print "hello world" in the new window and leave the console I used to run the script empty... (same happens with Cygwin) using CMD it won't even open the Python window and just closes gives me back a new CMD prompt-line.
Even worse when using PyCharm each time a background-task runs (eg syntax-check) a black console window opens for ~1 sec. and thus blocks me from writing code.
Example images to show what is happening:
Code used for test.py:
while True:
print("Hello World")
So far I tried:
python.exe
/ pythonw.exe
PYTHONENCODING
and PYTHONIOENCODING
to UTF-8//edit:
the Question is: How can I get back the default Python behavior, as seen on every other (Windows) Computer.
我发现解决方案只是以管理员身份运行 cmd 或 powershell,任何其他类型的用户都会导致此问题。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.