locate executables for different platforms

DevPlayer devplayer at gmail.com
Mon Oct 31 11:01:19 EDT 2011


On Oct 31, 10:00 am, Andrea Crotti <andrea.crott... at gmail.com> wrote:
> Suppose that I have a project which (should be)/is multiplatform in python,
> which, however, uses some executables as black-boxes.
>
> These executables are platform-dependent and at the moment they're just
> thrown inside the same egg, and using pkg_resources to get the path.
>
> I would like to rewrite this thing being able to:
> - detect the OS
> - find the right executable version
> - get the path and run it
>
> It would be nice to still be able to use pkg_resources, but at that
> point I think
> I would need to store all the executables in another egg, is that correct?
> Is there already something available to manage external multi-platform
> executables?
>
> Thanks,
> Andrea

While this doesn't answer your question fully, here is a beta snippet
I wrote in Python, that returns a list of full pathnames, for a set of
specified filenames, found in paths specified by PATH environment
variable. Only tested on WIN32. Note on WIN32 systems the snippet
tries to find filenames with extensions specified by the environment
varible PATHEXT. On Unix it will also try with no extension, of cource
(not tested). Enjoy.






More information about the Python-list mailing list