title: Is it possible to simulate keypress in Python without any Import Module/library
body: <p>I am using Python (2.4) and trying to simulate a key press (CTRL, SHIFT). But my python is built into a Media application/framework (From Peavey) that allows me to do very basic coding in Python but does not have the capability to install/import any modules, libraries. </p>
  
  <p>So I can't use any of the libraries/modules for key press such as : Keyboard, pyinput, ctype, Win32, wintype etc.  </p>
  
  <p>Is there any way to simulate a Keypress without using "import" at the top of the script?</p>
  
  <p>Thank you in advance...</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>import keyboard  # using module keyboard
  while True:  # making a loop
      try:  # used try so that if user pressed other than the given key error will not be shown
          if keyboard.is_pressed('q'):  # if key 'q' is pressed 
              print('You Pressed A Key!')
              break  # finishing the loop
          else:
              pass
      except:
          break  # if user pressed a key other than the given key the loop will break
  
  </code></pre>
  
  <p>But when executed, it gives me Error stating:</p>
  
  <pre><code>Traceback (most recent call last):
    File "key.py", line 1, in ?
      import keyboard  # using module keyboard
  ImportError: No module named keyboard
  </code></pre>
  
  <p>And I can't import the library when I use the code in production.</p>