14 lines
261 B
Python
14 lines
261 B
Python
#!/usr/bin/python
|
|
import socket
|
|
import sys
|
|
sock = socket.socket(socket.AF_UNIX)
|
|
sock.connect("/tmp/nfc.sock")
|
|
sock.settimeout(1)
|
|
|
|
for cmd in sys.argv[1:]:
|
|
sock.send(cmd.encode('utf-8') + b'\n')
|
|
try:
|
|
print(sock.recv(1024))
|
|
except socket.timeout:
|
|
continue
|