title: Python evdev and bar code scanner
body: <p>I have a following code which I use to catch input from bar code scanner. The problem is in that I want to save whole scanned code in database, but every character of code prints on new line:</p>
  
  <pre><code>#!/usr/bin/env python
  
  from evdev import InputDevice, ecodes, list_devices
  from select import select
  
  keys = "X^1234567890XXXXqwertzuiopXXXXasdfghjklXXXXXyxcvbnmXXXXXXXXXXXXXXXXXXXXXXX"
  dev = InputDevice("/dev/input/event10")
  
  barcode = ""
  while True:
      r,w,x = select([dev], [], [])
  
      for event in dev.read():
          if event.type == 1 and event.value == 1:
               barcode += (keys[event.code])
  
      print barcode
  
  # sudo ./bar-code-test.py                                                                           
  #0
  #00
  #00
  #000
  #001
  #1001
  #0017
  #70017
  #00170
  #000170
  #001708
  #8001708
  #0017085
  #50017085
  #00170853
  #300170853
  #001708531
  #1001708531
  #0017085316
  #60017085316
  #00170853160
  #000170853160
  #001708531601
  #1001708531601
  #0017085316013
  #30017085316013
  #00170853160131
  #100170853160131
  #00170853160131X
  #00170853160131X
  </code></pre>
  
  <p>I Am newbie with python, so any help will be appreciated.</p>