Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- import sys
- import time
- #s = socket.socket()
- #s.connect(("localhost",9999))
- def sendFile(filename):
- s = socket.socket()
- s.connect(("localhost",9999))
- f = open (filename, 'rb')
- l = f.read(1024)
- while (l):
- s.send(l)
- l = f.read(1024)
- f.close()
- s.close()
- sendFile("test.txt")
- time.sleep(1)
- sendFile("test2.txt")
Add Comment
Please, Sign In to add comment