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

Use python3 to print a progress bar counter method

高洛峰
高洛峰Original
2017-03-26 18:23:551660browse

# 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!

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