Guest User

Untitled

a guest
Nov 21st, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import socket
  2. s = socket.socket()
  3.  
  4. host = 'csmpop.ddns.net'
  5. port = [33331]
  6.  
  7. s.connect((host,port))
  8. student_id = 's5067168'
  9.  
  10. print "Requesting archive with ID: {}".format(student_id)
  11.  
  12. s.send(student_id)
  13.  
  14. f = open('received_files.zip','wb')
  15. l = s.recv(1024)
  16.  
  17. while (l):
  18. print "Receiving..."
  19. f.write(l)
  20. l = s.recv(1024)
  21.  
  22. f.close()
  23. print "Done Receiving"
  24. s.shutdown(socket.SHUT_WR)
  25. s.close()
Add Comment
Please, Sign In to add comment