1880dd5fab7a2c1c138c54f9d9524004e243826d
[saartuer.git] / tryshell
1 #!/usr/bin/python3
2
3 import readline
4 import socket
5
6 tuerSock = "/run/tuer.sock"
7
8 while True:
9         command = input("# ") # EOFError used to exit
10         s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
11         s.connect(tuerSock)
12         s.send(command.encode())
13         while True:
14                 data = s.recv(256)
15                 if not len(data): break
16                 print(data)
17         s.close()