出力の一時停止と再開
Posted feedbacks - Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import curses
w = curses.initscr()
try:
curses.noecho()
w.timeout(1000)
flg = True
while True:
c = w.getch()
if c == -1 and flg:
w.addch('a')
elif c == ord('q'):
break
elif c == ord('p'):
flg = not flg
except:
pass
curses.endwin()
|


nobsun
#6346()
Rating3/3=1.00
起動すると、標準出力に1秒毎に'a'の1文字を出力し続けるプログラムで、 以下の条件を満たすものを「どう書く?」
[ reply ]