Retourner au contenu associé (journal : Portage de TapTempo en Perl)
Posté par manatlan (site web personnel) le 27 février 2018 à 21:29. En réponse au journal Portage de TapTempo en Perl. Évalué à 0.
la version ++ :
#!/usr/bin/python # -*- coding: utf-8 -* import sys,termios,tty,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 print "tapTempo : press any key (q for quit)" t=[] while getKey()!="q": t.append( datetime.datetime.now() ) ll=[ (j-i).microseconds for i, j in zip(t[:-1], t[1:]) ][-5:] print "BPM:",60000000*len(ll)/sum(ll)
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: ma version en python 2.7 ;-)
Posté par manatlan (site web personnel) . En réponse au journal Portage de TapTempo en Perl. Évalué à 0.
la version ++ :