I want to make a python script run on a socket of server in LAN. I wrote a number guessing script and i want to make it run on socket for other clients to play with it by connecting to port (say 1234). I know to achieve this by socket programming from python. But this question is to ask as to why this fails?
ncat 192.168.0.108 -lvp 1234 -e /usr/bin/python3.5 number_game.py
#!/usr/bin/python3.5 import random num=random.randint(1,20) flag=0 print("Welcome to the game...") for i in range(1,7): print("Take a guess") guess=int(input()) if guess > num: print("Way too high") else: if guess < num: print("Way too low") else: flag=1 break; if flag == 1: print("You made it in "+str(i)+" attempts") else: print("better luck next time")
Ncat: Version 7.31 ( https://nmap.org/ncat )
Ncat: Got more than one port specification: 1234 number_game.py. QUITTING.