Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- def run():
- host = "192.168.1.2"#host derp
- port = 9753#port derp
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- idle()
- def idle():
- Choice = raw_input("Would you like to 1)Recieve 2)Send?: ")
- if Choice == "1":
- recievey
- elif Choice == "2":
- sentence = raw_input("What would you like to send?: ")
- sendy
- def sendy():
- sock.connect((host, port))
- sock.send(sentence)
- idle()
- def recievey():
- results = sock.recv(1024)
- sock.close
- print results
- idle()
- run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement