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

Mats Wichmann mats at wichmann.us
Wed Jul 12 15:50:01 EDT 2017


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.



More information about the Scons-users mailing list