title: Python File reader convert invalid literal
body: <p>I have been trying to make python code that reads a text file makes it a variable and sends it using i2c. Heres the code:</p>
  
  <pre><code>import serial
  import smbus
  import time
  import sys
  
  from time import sleep
  
  
  
  # for RPI version 1, use "bus = smbus.SMBus(0)"
  bus = smbus.SMBus(1)
  
  # This is the address we setup in the Arduino Program
  address = 0x04
  
  loopvar = 1
  
  while loopvar == 1:
      text_file = open("./PB_Vision/command.txt", "r")
      print text_file.read()
      visioncommando = text_file.read()
      print visioncommando
  
      def writeNumber(value):
          bus.write_byte(address, value)
          bus.write_byte_data(address, 0, value)
          return -1
  
      var = int(visioncommando)
      writeNumber(var)
      print ("RPI: Hi Arduino, I sent you")
      print (var)
  
      text_file.close()
  </code></pre>
  
  <p>when I run this, I get this as output;</p>
  
  <pre><code>110
  
  Traceback (most recent call last):
   File "testai.py", line 29, in &lt;module&gt;
    var = int(visioncommando)
  ValueError: invalid literal for int() with base 10: ''
  </code></pre>
  
  <p>any suggestion, fixes?</p>
  
  <p>anyways thanks in advance.</p>
  
  <p>Thanks your suggestions worked, one step closer  to an working project.</p>