title: Don't print result after calling get_axis() in pygame
body: <p>I'm writing a code that reads the value of a joystick axis and then sends this value to an arduino. It works, however I do not want it constantly print 0 to the LXTerminal when nothing is being pressed.</p>
  
  <p>The code prints: <code>SDL_JoystickGetAxis value:0:</code> repeatably when the axis is not being pressed.</p>
  
  <p>It then prints:</p>
  
  <pre><code>SDL_JoystickGetAxis value:-32768:
  SDL_JoystickGetAxis value:0:
  SDL_JoystickGetAxis value:-32768:
  The left drive is
  -1.0
  </code></pre>
  
  <p>Repeatably when the axis is being pulled all the way down, or a number between -1 and 1 depending where the joystick is.</p>
  
  <p>I only want it to print <code>The left drive is &lt;leftDrive&gt;</code> when the left axis is being pressed, and then nothing when it is not. How do I achieve this?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import pygame
  
  pygame.init()
  pygame.joystick.init()
  joystick = pygame.joystick.Joystick(0)
  joystick.init()
  leftDrive = 0
  rightDrive = 0
  
  while True:
      try:
          pygame.event.pump()
  
          joyCheckLeft = joystick.get_axis(1)
          joyCheckRight = joystick.get_axis(2)
  
          if joyCheckLeft != 0:
              pygame.event.pump()
              leftDrive = joystick.get_axis(axisLeftDrive)
              print 'The left drive is'
              print leftDrive
              writeNumber(int(2+(leftDrive*-10)))
              pygame.event.pump()
              time.sleep(0.1)
  
  except KeyboardInterrupt:
      quit()
  </code></pre>
  
  <p>Note: The code doesn't work without <code>pygame.event.pump()</code>. This is needed so that "get_axis()" actually returns the value of the axis.</p>