python实现的小功能

输出星座符号

for i in range(12):
print(chr(9800+ i), end="")

python创建进度条(借鉴的,具体哪里的我也记不得了。。)

import time
scale = 50
print(“执行开始”.center(scale//2,"-"))
start = time.pref_counter()
for i in range(scale+1):
a = ‘*’ * i
b = ‘.’ *(scale - i)
c = (i/scale)*100
dur = time.pref_counter() - start
print("\t{:^3.0f}%[{}->{}]{:.2f}s".format(c,a,b,dur), end=’’)
time.sleep(0.1)
print("\n"+“执行结束”.center(scale//2, ‘-’))

你可能感兴趣的:(学习笔记,python)