Hi, Daniel

Mark Sapiro writes:

 > On 3/4/21 7:06 AM, Daniel Botting wrote:

 > > My script and usage so far can be found below:

<applause/>

 > This was asked and answered at
 > <https://answers.launchpad.net/ubuntu/+source/mailman/+question/695864>
 > 
 > The answer there was correct and is you are generating the password once
 > as part of the withlist command line and passing the one single output
 > of `pwgen -sB 15 1` as the password argument to the script. You need to
 > generate a password within the script.

I think

    newpassword = subprocess.run(["pwgen", "-sB", "15", "1"],
                                 capture_output=True,
                                 text=True).stdout

will do the trick (be careful about text=True, though; you may want
the default text=False so that stdout will be bytes instead of str).

https://docs.python.org/3/library/subprocess.html#subprocess.run

Steve

------------------------------------------------------
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
    https://mail.python.org/archives/list/mailman-users@python.org/

Reply via email to