-def zephyr(msg, clas='remit', instance='log', rcpt='adehnert',):
- import os
- os.system("zwrite -d -c '%s' -i '%s' '%s' -m '%s'" % (clas, instance, rcpt, msg, ))
+def zephyr(msg, clas='message', instance='log', rcpt='nobody',):
+ proc = subprocess.Popen(
+ ['zwrite', '-d', '-n', '-c', clas, '-i', instance, rcpt, ],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE
+ )
+ proc.communicate(msg)