Advertisement
Guest User

client

a guest
Apr 25th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. for fil in files:
  2.             try:
  3.                 f = open(fil,'rb')
  4.                 fil = fil.split('/')[-1]
  5.                 self.cl_socket.send(fil+"%%eofn%%")
  6.                 print "Sending file...%s"%fil,
  7.                 while 1:
  8.                     data = f.readline()
  9.                     if not data:
  10.                         break
  11.                     self.cl_socket.send(data)
  12.                 print " Done!"
  13.             except Exception,e:
  14.                 print e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement