#!/usr/bin/python2.7
# -*- coding: iso-8859-1 -*-
-import glob, sys, os, time
+import glob, sys, os, time, select
def main(argv=None):
file=""
sys.exit()
message = "Ok, file : %s is valid." % file
print >>sys.stdout,message
+ message = "Press Enter key to exit\n"
+ print >>sys.stdout,message
taille=os.path.getsize(file)
compteur=0
time.sleep(1)
message = " Instantané Moyenne Gio/Heure"
print >>sys.stdout,message
- while 1:
+ while True:
+# Main
timer1=time.clock()
ancienne_taille=taille
taille=os.path.getsize(file)
sys.stdout.flush()
timer2=time.clock()
time.sleep(1-(100*timer2-100*timer1))
+# Main done
+# Exit on key press
+ if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
+ line = raw_input() # Clear stdin before stop
+ break
if __name__ == "__main__":
sys.exit(main())
-