title: multiple send from server to client python
body: <p>First I am sending the requested file from the server to the client and after that I want to send the computed sha of the file from the server to the client, so that the client can check if both the sha from the sent and the received files are the same.</p>
  
  <p>I manage to send the file but when I try to also send the sha (which is a variable) I receive a error ( i believe that the sha is also added to the file content)</p>
  
  <p>How can i send them separately?</p>
  
  <pre><code>if (reqCommand == 'get'):
      with open (reqFile, 'rb') as in_file, open(encFile, "wb") as out_file:
          encrypt(in_file, out_file, "abc")
          f = open(encFile,'rb')
          for data in f:
              # print 'here3'
              conn.sendall(data)
          f.close()
  
          file_sh = hashfile(reqFile)
          print 'the sha1 function from the server: ', file_sh
          conn.send(file_sh)
  </code></pre>
  
  <p>and the client:</p>
  
  <pre><code>while True:
      data = sock.recv(1024)
  
      if not data:
          break
      #print data
      file_to_write.write(data)
  </code></pre>