#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
choice = input("是否退出?")
if choice == 'Y' or choice == 'y':
exit('成功退出了')#这里面还可以输出内容,很好玩
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys,time
for i in range(100):
sys.stdout.write('#') #python打印进度条,python2.7可用
time.sleep(0.3)
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys,time
'''
Python打印进度条,比较美观
'''
for i in range(31):
sys.stdout.write('
') #每一次清空原行
sys.stdout.write('%s%% |%s' %((int(i/30*100), int(i/30*100)*'*')))
sys.stdout.flush() #强制刷新到屏幕
time.sleep(0.3)