From: Leandro Lucarella Date: Mon, 12 Nov 2007 16:54:52 +0000 (-0300) Subject: Add a small utility to send pymin commands. X-Git-Url: https://git.llucax.com/software/pymin.git/commitdiff_plain/722e355a1d01c2620dc665af8ffaa8f7b0d04994?ds=sidebyside;hp=--cc Add a small utility to send pymin commands. --- 722e355a1d01c2620dc665af8ffaa8f7b0d04994 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] +