[Mailman-Users] Questions Regarding Command Line Commands

Mark Sapiro msapiro at value.net
Thu Jan 26 03:18:10 CET 2006


Mark Phillips wrote:
>
>I have seen the documentation on what the command line
>commands are, but I am not sure how to issue those
>commands from a python script.


See <http://docs.python.org/lib/os-process.html>

Briefly, once you have the list name, owner email and list password in
appropriate variables, and the members in a file, you can do something
like

import os
stat = os.spawnl(os.P_WAIT, 'path/to/bin/newlist', 'newlist', '-q',
                 list_name, owner_email, list_password)
if stat:
    print 'newlist command failed - %d' % stat
    ...
stat = os.spawnl(os.P_WAIT, 'path/to/bin/add_members', 'add_members',
                 '-r members file', '-w y', ...)
...

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list