mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-21 21:16:24 +02:00
UI.
This commit is contained in:
parent
c452fa738f
commit
b976e4b5d8
1 changed files with 16 additions and 0 deletions
16
ui.py
Normal file
16
ui.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
"""
|
||||
Author: Sergey Vartanov (me@enzet.ru).
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
def write_line(number, total):
|
||||
if number == -1:
|
||||
print ('%3s' % '100') + ' %: [' + (100 * '=') + '].'
|
||||
elif number % 1000 == 0:
|
||||
p = number / float(total)
|
||||
l = int(p * 100)
|
||||
print ('%3s' % str(int(p * 1000) / 10)) + ' %: [' + (l * '=') + \
|
||||
((100 - l) * ' ') + '].'
|
||||
sys.stdout.write("\033[F")
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue