1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
# ENVIRONNEMENT !!
if sys.platform.startswith("linux"):
isLINUX = True
import tty
import termios
else:
isLINUX = False
import msvcrt
def ClearScreen ():
"effacer la console"
if isLINUX :
os.system('clear')
else:
os.system('cls')
def getChar ():
"saisie d'un caractère sans retour chariot"
if isLINUX :
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
return sys.stdin.read(1)
else:
return msvcrt.getch()
def nextPage ():
print u"\n\n---------- appuyer sur une touche pour continuer, sur q pour quitter ----------"
char = getChar()
if char == 'q' or char == 'Q' :
return False
return True
def attendClavier ():
print u"\n\n--------------- terminé ; appuyer sur une touche pour continuer ---------------"
char = getChar()
def msgAnnulation ():
print u"\n\n---------- opération annulée ; appuyer sur une touche pour continuer ----------"
char = getChar() |
Partager