Пример #1
0
import moveto
degrees = 90
moveto.moveto(degrees)
Пример #2
0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Socket created'
 
try:
    s.bind((HOST, PORT))
except socket.error , msg:
    print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
    sys.exit()
     
print 'Socket bind complete'
 
s.listen(10)
print 'Socket now listening'
 
#now keep talking with the client
while 1:
    #wait to accept a connection - blocking call
    conn, addr = s.accept()
    print 'Connected with ' + addr[0] + ':' + str(addr[1])
     
    data = conn.recv(1024)
    reply = 'OK...' + data

    if not data: 
        break
    
    conn.sendall(reply)
    move_it = moveto.moveto(90) 
    
conn.close()
s.close()
Пример #3
0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Socket created'

try:
    s.bind((HOST, PORT))
except socket.error, msg:
    print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
    sys.exit()

print 'Socket bind complete'

s.listen(10)
print 'Socket now listening'

#now keep talking with the client
while 1:
    #wait to accept a connection - blocking call
    conn, addr = s.accept()
    print 'Connected with ' + addr[0] + ':' + str(addr[1])

    data = conn.recv(1024)
    reply = 'OK...' + data

    if not data:
        break

    conn.sendall(reply)
    move_it = moveto.moveto(180)

conn.close()
s.close()
Пример #4
0
print "Socket created"

try:
    s.bind((HOST, PORT))
except socket.error, msg:
    print "Bind failed. Error Code : " + str(msg[0]) + " Message " + msg[1]
    sys.exit()

print "Socket bind complete"

s.listen(10)
print "Socket now listening"

# now keep talking with the client
while 1:
    # wait to accept a connection - blocking call
    conn, addr = s.accept()
    print "Connected with " + addr[0] + ":" + str(addr[1])

    data = conn.recv(1024)
    reply = "OK..." + data

    if not data:
        break

    conn.sendall(reply)
    move_it = moveto.moveto(180)

conn.close()
s.close()
Пример #5
0
import moveto

degrees = 90
moveto.moveto(degrees)