title: Python Error ValueError: invalid literal for int() with base 10 ' '
body: <p>I am new to Python 3.3 and I am starting to write a little guessing game using sockets. However I keep getting the error <code>ValueError: invalid literal for int() with base 10: ''</code><br>
  I can't see why I get this error in the line <code>currentGuess = int(currentGuess)</code> as I have a similar line earlier in my code. If anyone could help me I would be very grateful. Here is my server and Client code. I have looked at other solutions with similar problems but I can't get any to work for me.</p>
  
  <p>Server</p>
  
  <pre><code>    #!/usr/bin/python
      import random
      import sys
      import math
      import  socket
  
      l = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      l.bind(("127.0.0.1", 4007))
      l.listen(5)
      print("Waiting...")
      while True:
            (s,  ca) = l.accept()
            print("Connection  from",  ca)
  
            #Name
            s.send("What is your name?". encode())
            names = s.recv(1024).decode()
            #Guesses
  
            s.send("How many guesses would you like?".encode())
            guesses = s.recv(1024).decode()
            guesses = int(guesses)
            #Random Number
  
            correctNumber = random.randrange(0,10)
            print(correctNumber)
  
            #Make Guesses
            count = 0
            while count &lt; guesses:
                  s.send("Take a Guess".encode())
                  currentGuess = s.recv(1024).decode()
                  currentGuess = int(currentGuess)
                  if currentGuess == correctNumber:
                     s.send("You WIN".encode())
                  if currentGuess != correctNumber:
                     s.send("Incorrect, Try Again ".encode())
                     count = count + 1
  
      s.close()
  </code></pre>
  
  <p>Client</p>
  
  <pre><code>    #!/usr/bin/python
      import random
      import sys
      import math
      import socket
  
      s = socket.socket(socket.AF_INET,   
      socket.SOCK_STREAM)
      s.connect(("127.0.0.1", 4007))
      print("Wlcome to the numer guessing game")
  
      #Name
      print(s.recv(1024).decode())
      name = sys.stdin.readline()
      s.send(name.encode())
  
      #guesses
      print(s.recv(1024).decode())
      guesses = sys.stdin.readline()
      s.send(guesses.encode())
  
      #Make Guesses
      print(s.recv(1024).decode())
      currentGuess = sys.stdin.readline()
      s.send(currentGuess.encode())
      print(s.recv(80).decode())
      s.close()
  </code></pre>