Skip to content

Commit 3259498

Browse files
committedMay 2, 2020
add new example
1 parent 70af6f5 commit 3259498

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

‎.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Auto detect text files and perform LF normalization
22
* text=auto
3+
4+
*.ipynb linguist-language=Python

‎Example/ProgressBar.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python
2+
#-*- coding:utf-8 -*-
3+
# Author: DevLiuSir
4+
# Contact: liuchuan910927@hotmail.com
5+
# File: ProgressBar.py
6+
# Datetime: 2018/11/22 14:59
7+
# Software: PyCharm
8+
9+
10+
# ================ 进度条 ===========
11+
12+
13+
import time
14+
15+
length = 1000
16+
for i in range(1, length + 1):
17+
percent = i / length
18+
bar = '▉' * int(i // (length / 50))
19+
time.sleep(0.01)
20+
print('\r进度条:|{:<50}|{:>7.1%}'.format(bar, percent), end='')
21+
print('\n')

0 commit comments

Comments
 (0)