Retourner au contenu associé (journal : Portage de TapTempo en Perl)
Posté par manatlan (site web personnel) le 27 février 2018 à 21:14. En réponse au journal Portage de TapTempo en Perl. Évalué à -3. Dernière modification le 27 février 2018 à 21:17.
#!/usr/bin/python # -*- coding: utf-8 -* import sys,termios,tty from datetime import datetime def getKey(): fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: tty.setraw(fd) ch = sys.stdin.read(1) finally: termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch t=[] while 1: k=getKey() if k=="q": break else: t.append( datetime.now() ) t=t[-5:] ll=[ (j-i).microseconds for i, j in zip(t[:-1], t[1:])] print 60000/((sum(ll)/len(ll))/1000.0)
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# ma version en python 2.7 ;-)
Posté par manatlan (site web personnel) . En réponse au journal Portage de TapTempo en Perl. Évalué à -3. Dernière modification le 27 février 2018 à 21:17.