neo1973-germany/PyTracker/client.py
edistar 604d68c975 This is the first pre-alpha code of the PyTracker project
The PyTracker project seeks to create a simple tracking app, not with 
all the bloat TangoGPS creates (which is not needed)



git-svn-id: http://www.neo1973-germany.de/svn@150 46df4e5c-bc4e-4628-a0fc-830ba316316d
2008-09-16 14:41:51 +00:00

27 lines
429 B
Python

# Client program
from socket import *
# Set the socket parameters
host = "localhost"
port = 49152
buf = 1024
addr = (host,port)
# Create socket
UDPSock = socket(AF_INET,SOCK_DGRAM)
def_msg = "===Enter message to send to server===";
print "\n",def_msg
# Send messages
while (1):
data = raw_input(">> ")
if not data:
break
else:
UDPSock.sendto(data,addr)
print "Sending message", data
# Close socket
UDPSock.close()