On 03.09.19 05:28, rmli...@riseup.net wrote:

> But I just don't understand how to get
> and pass information back to the gpg command line prompts at all, not to
> mention automating the process.

The manpage describes how to enable the machine-parsable interface,
which is exactly what you want. Then:

import subprocess
inputs = [
        "11",
        "Q",
        "1",
        "0",
        "y",
        "username",
        "usern...@user.net",
        "none",
        "O",
]
input_data = ("\n".join(inputs) + "\n").encode()
subprocess.check_output([ "gpg2", "--expert", "--full-gen-key",
"--with-colons", "--command-fd", "0", "--status-fd", "1" ], input =
input_data)

Cheers,
Joe


-- 
"Performance ist nicht das Problem, es läuft ja nachher beides auf der
selben Hardware." -- Hans-Peter Diettrich in d.s.e.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to