SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from pynput import keyboard
  2. import time
  3.  
  4. buff = []
  5. str_l = '>'
  6.  
  7.  
  8. def on_release(key):
  9.     global buff, str_l
  10.     try:
  11.         if key == keyboard.Key.enter:
  12.             str_l = "".join(buff)
  13.             buff = []
  14.         elif ord(str(key).replace("\'", '')) in range(ord('a'), ord('z')) or ord(str(key).replace("\'", '')) in range(
  15.                 ord('A'), ord('Z')):
  16.             buff.append(str(key).replace("\'", ''))
  17.     except:
  18.         pass
  19.  
  20.  
  21. listener = keyboard.Listener(
  22.     on_release=on_release)
  23. listener.start()
  24.  
  25. i = 0
  26. while True:
  27.     print(str(i) + str_l)
  28.     time.sleep(1)
  29.     i += 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top