mirror of https://github.com/m-labs/artiq.git
kasli_tester: add support for windows platform. (#1204)
This commit is contained in:
parent
7358262ab3
commit
34d0f592f1
|
@ -1,8 +1,12 @@
|
|||
import sys
|
||||
import os
|
||||
import select
|
||||
|
||||
from artiq.experiment import *
|
||||
|
||||
if os.name == "nt":
|
||||
import msvcrt
|
||||
|
||||
|
||||
def chunker(seq, size):
|
||||
res = []
|
||||
|
@ -16,6 +20,12 @@ def chunker(seq, size):
|
|||
|
||||
|
||||
def is_enter_pressed() -> TBool:
|
||||
if os.name == "nt":
|
||||
if msvcrt.kbhit() and msvcrt.getch() == b"\r":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
if select.select([sys.stdin, ], [], [], 0.0)[0]:
|
||||
sys.stdin.read(1)
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue