From 722e355a1d01c2620dc665af8ffaa8f7b0d04994 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 12 Nov 2007 13:54:52 -0300 Subject: [PATCH] Add a small utility to send pymin commands. --- send_command.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 send_command.py diff --git a/send_command.py b/send_command.py new file mode 100755 index 0000000..1533a83 --- /dev/null +++ b/send_command.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +import sys +import socket + +s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + +host = sys.argv[1] +port = int(sys.argv[2]) + +s.bind(('', port+1)) + +s.sendto(sys.stdin.read(), 0, (host, port)) + +print + +print s.recvfrom(4096)[0] + -- 2.43.0