I'm very new to development and may I know the equivalent python script for the following net cat command.
nc -v localhost 11211
#UPDATE
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect(('localhost', 11211))
data = s.recv(1024)
print(s.sendall(data.encode('get STATUS_MANAGER_KEYS')))
except:
print('error')
finally:
s.close()
Changed it as above but it showing an infinite execution at line data = s.recv(1024). May I know how to solve this.