import subprocess exe = "signal-cli" def send(contacts, message): subprocess.run([ exe, "send", *contacts, "-m", message ], encoding="utf-8") def receive(): subprocess.run([ exe, "receive" ])