[Scons-users] advantages to scons facilities vs. python ones?

Bill Deegan bill at baddogconsulting.com
Wed Jul 12 16:35:46 EDT 2017


Mats,

It really depends in what context.

Are you trying to find out the current state of the system (as above
looking for installed tools), then python is likely the right way.
Are you trying to do something with an object which may or may not yet be
built, then likely use SCons.

-Bill

On Wed, Jul 12, 2017 at 3:50 PM, Mats Wichmann <mats at wichmann.us> wrote:

>
> Just wondering...
>
> this codebase I'm poking at does a number of things directly in Python,
> I'm curious if it's demonstrably better to use SCons facilities if there
> is something similar supported.  For one example, os.path.exists is used
> for checking for things (in this example, for tools outside the code
> tree itself):
>
> # Detect the toolchain version
> for tc_ver in ['4.7', '4.8', '4.9']:
>     if os.path.exists(android_ndk + '/toolchains/x86-' + tc_ver):
>         break
> else:
>     tc_ver = None
>
>
> This works, of course.
>
> SCons has some Find* methods, none of which are anywhere used in this
> codebase. Do they bring advantages when looking things up?
>
> Other instances of "using Python" when there seem to be SCons support
> include os.mkdir, shell commands through os.system/commands/subprocess
> to do cp, mv, rm, chmod; os.path.isfile, os.path.isdir, etc.
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170712/16771917/attachment.html>


More information about the Scons-users mailing list