Facon portable d'effacer une ligne
darcs-hash:20041129143642-d1718-54fb785f2e91b3c7ad9d40f70fc711a3a57a309d.gz
This commit is contained in:
parent
a4fddfc763
commit
3ec9771253
1 changed files with 5 additions and 3 deletions
|
@ -9,6 +9,8 @@ Licence : GPLv2
|
||||||
|
|
||||||
import sys, sre, os, tempfile
|
import sys, sre, os, tempfile
|
||||||
|
|
||||||
|
el = os.popen('tput cr ; tput el').read()
|
||||||
|
|
||||||
def dialog(backtitle,arg) :
|
def dialog(backtitle,arg) :
|
||||||
""" Affiche la boite de dialogue défine avec les arguments fournis
|
""" Affiche la boite de dialogue défine avec les arguments fournis
|
||||||
(cf man dialog)
|
(cf man dialog)
|
||||||
|
@ -164,17 +166,17 @@ class anim :
|
||||||
def reinit(self) :
|
def reinit(self) :
|
||||||
""" Efface la ligne courrante et
|
""" Efface la ligne courrante et
|
||||||
affiche : truc................. """
|
affiche : truc................. """
|
||||||
sys.stdout.write('\r' + self.txt)
|
sys.stdout.write(el + self.txt)
|
||||||
if self.iter :
|
if self.iter :
|
||||||
sys.stdout.write(' '*28)
|
sys.stdout.write(' '*28)
|
||||||
sys.stdout.write('\r' + self.txt)
|
sys.stdout.write(el + self.txt)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def cycle(self) :
|
def cycle(self) :
|
||||||
""" Efface la ligne courrante et
|
""" Efface la ligne courrante et
|
||||||
affiche : truc..................?
|
affiche : truc..................?
|
||||||
? caratère variant à chaque appel """
|
? caratère variant à chaque appel """
|
||||||
sys.stdout.write('\r' + self.txt)
|
sys.stdout.write(el + self.txt)
|
||||||
if self.iter!=0 :
|
if self.iter!=0 :
|
||||||
sys.stdout.write('[')
|
sys.stdout.write('[')
|
||||||
av = float(self.c) / float(self.iter)
|
av = float(self.c) / float(self.iter)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue