import datetime
import threading
import time
import keyboard
import schedule
def block_keyboard():
print("block...", datetime.datetime.now())
for i in range(150):
keyboard.block_key(i)
threading.Timer(10, unblock_keyboard).start()
def unblock_keyboard():
print("unblock...", datetime.datetime.now())
for i in range(150):
keyboard.unblock_key(i)
threading.Timer(10, block_keyboard).start()
def job():
block_keyboard()
threading.Timer(10, unblock_keyboard).start()
if __name__ == '__main__':
print("start...", datetime.datetime.now())
block_keyboard()
# schedule.every(10).seconds.do(job)
# while True:
# schedule.run_pending()