Home  >  Article  >  Backend Development  >  What should I do if python opens the py file and it flashes?

What should I do if python opens the py file and it flashes?

coldplay.xixi
coldplay.xixiOriginal
2020-06-18 11:06:0413423browse

What should I do if python opens the py file and it flashes?

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

What should I do if python opens the py file and it flashes?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn