Home > Backend Development > Python Tutorial > How to pause execution in Python3.X

How to pause execution in Python3.X

little bottle
Release: 2019-04-09 11:25:20
forward
3101 people have browsed it

Nowadays, a large part of the statements in Python3 are not interoperable with Python2. Many functions are slightly different, and the methods of running pauses are also different. Today I will take you to learn about the method of running pauses in Python3. .

1. input();

This method does not need to include modules, so this is also the most commonly used pause method.

The raw_input() and input() statements in Python2 have been merged into input() in Python3.

2. os.system("pause");

This method needs to include the os module (import os). Running IDLE under Windows will pop up the cmd command line,

Perform a pause operation. Directly running the .py file will pause directly in the command line.

3. time.sleep("second");

This method needs to include the time module (import time), second is a customized time length, depending on the actual situation,

Fluctuations may occur.

[Recommended course: Python3 video tutorial]

The above is the detailed content of How to pause execution in Python3.X. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template