Code: Alles auswählen
def client_function():
print "Connecting to a server..."
sys.stdout.write("Server?: ")
host = stdin.readline().rstrip("\n")
sys.stdout.write("Port?: ")
port = stdin.readline().rstrip("\n")
c = Client(host, int(port))
c.send_packet("hello!")
sleep(0.01)
i = 0
# wait to get packetConfirm
while i < 3:
c.Loop()
sleep(0.1)
i += 1
client_function()
Code: Alles auswählen
C:\Users\tomycat\Documents>client.py
File "C:\Users\tomycat\Documents\client.py", line 2
print "Connecting to a server..."
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Connecting to a server...")?
C:\Users\tomycat\Documents>