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

coldplay.xixi
Release: 2020-06-18 11:06:04
Original
13434 people have browsed it

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'
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template