title: How to index an unpickled list?
body: <p>I'm making a LAN multiplayer arena shooter using pygame and sockets and am having troubling transferring pickled object data from server to client. I have 2 objects, player and projectile (the bullets). I don't know how to send multiple objects at once, so i decided to put the 2 objects in a list and pickle them. But when unpickling, I can't index the list as I keep getting the 'EOFError: Ran out of input'</p>
  
  <p>So I want to unpickle the list that I receive and separate out the 2 objects in that list. But python won't let me index the list after I unpickled them. Any help would be much appreciated.
  Here's my code:</p>
  
  <pre><code>#instantiating instances for Player and Projectile classes
  
  players=[Player(450,400,"sprite1.png",1),Player(500,400,"sprite2.png",2)]
  bullets=[Projectile(50,50,5,"right","projectile.png",0)]  
  
  def threaded_client(conn, player):
      player_data=(players[player])
      bullet_data=(bullets[player])
      alldata=[player_data,bullet_data]    #putting the 2 objects in a list.
      conn.send(pickle.dumps(alldata))     #pickling list
  
      reply = ""
      while True:
      try:
          alldata = pickle.loads(conn.recv(2048))
          players[player] = alldata[0]
  ...
  
  self.client.connect(self.addr)
  alldata=pickle.loads(self.client.recv(2048)) #unpickling the list
  return alldata[0]   #trying to return the first object 
  </code></pre>