Home > Backend Development > Python Tutorial > Use python3 to print a progress bar counter method

Use python3 to print a progress bar counter method

高洛峰
Release: 2017-03-26 18:23:55
Original
1659 people have browsed it

# Auther: Aaron Fan

import sys,time

for i in range(30):
#Print a # number, this method will not automatically wrap the line
sys.stdout.write('#')
#Refresh in real time, otherwise the above statement will wait until all # numbers are written into the cache before printing it out at once
sys.stdout.flush ()
#Wait for 0.1 seconds for each # number to print
time.sleep(0.1)

The above is the detailed content of Use python3 to print a progress bar counter method. 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