1.监听键盘按键

from pynput.keyboard import Listener

def press(key):
      print(key.char)

with Listener(on_press = press) as listener:
        listener.join()