Suggest design to accomodate non-unix platforms ?

Richard Shea shearichard at gmail.com
Wed Apr 18 20:02:35 EDT 2012


On Apr 19, 2:28 am, tinn... at isbd.co.uk wrote:
> Richard Shea <shearich... at gmail.com> wrote:
> > On a *nix box this is a reasonable bit of Python :
>
> > cmd = "ssh -o StrictHostKeyChecking=no -i %s %s@%s '%s' > %s" % (key,
> > user, dns, "echo CONNECTION READY", tmp_file)
> > result = os.system(cmd)
>
> > ... on a Windows box it will fail because 'ssh' isn't part of Windows.
>
> ssh isn't guaranteed to be part of Unix/Linux systems surely.
>
> --
> Chris Green

Ha ! Ok I didn't know that (or more to the point hadn't really thought
about it). But anyway my more general point was looking for a design
pattern which would accommodate the use of system utilities across
multiple platforms which has sufficiently similar functionality that
they were functionally identical but which would have to be invoked in
different ways



More information about the Python-list mailing list