Suggest design to accomodate non-unix platforms ?

Miki Tebeka miki.tebeka at gmail.com
Wed Apr 18 20:16:08 EDT 2012


> So I'm interested in suggestions/examples where a user can update a
> config file to specify by which means they want (in this case) the ssh
> functionality to be supplied.
You can do something like that (it's called a factory):

COMMANDS = {
    'win32': 'win32 command goes here',
    'linux2': 'linux command goes here',
    'darwin': 'OSX command goes here',
}
def get_command():
    return COMMANDS.get(sys.platform)



More information about the Python-list mailing list