Resolve Python to run a pop-up cmd window on Windows (DOS window)

Source: Internet
Author: User

Running the Python program will display a CMD in the background, it is very simple to not display ( although I have been looking for 1 hours ...). To understand the basics )

Method 1:pythonw xxx.py

Method 2: Change the. py to. PYW (this is actually using the script resolver Pythonw.exe)

Original:

1)

Try changing the file extension to. pyw. Double-clicking A. Pyw would use Pythonw.exe instead of Python.exe.

Python.exe There's a console window when you run it. If your Python code has a GUI, running with Python.exe will run out of a black window if you use Phthonw.exe.
Compared with Python.exe, Pythonw.exe has the following differences: 1) do not eject the console window (also called DOS window) 2) all outputs to the original stdout and stderr are invalid 3) all reads from the original stdin will only be EOF.P The YW format is a purely graphical interface program designed to run the development process. Users of the Pure graphical interface program do not need to see the console window. It is worth mentioning that when developing a pure graphical interface program, you can temporarily change the. pyw to. py so that the runtime can bring up the console window and see all the error messages for easy removal. Note: Only the Windows version of Python has the. pyw format.

Original

Http://www.cnblogs.com/mmix2009/p/3536148.html

Resolve Python to run a pop-up cmd window on Windows (DOS window)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.