What should I do if python opens the py file in a flash?
A quick solution to opening py files in python:
In fact, the program is running, and after running, close the displayed window.
Unless your machine is running very stuck, you will not see any output under normal circumstances
Solution:
Add the "input()" function at the end of the program (wait Input function)
#!/usr/local/bin/python import sys print(sys.platform) print(2 ** 100) x = 'Spam' print(x * 8) print 'hello world'
The result shows:
When you double-click the .py file, you will see the printed information
Recommended tutorial: "python tutorial》
The above is the detailed content of What should I do if python opens the py file and it flashes?. For more information, please follow other related articles on the PHP Chinese website!