SCons User Guide 0.92 | ||
---|---|---|
<<< Previous | Construction Environments | Next >>> |
You can fetch individual construction variables using the normal syntax for accessing individual named items in a Python dictionary:
env = Environment() print "CC is:", env['CC'] |
This example SConstruct file doesn't build anything, but because it's actually a Python script, it will print the value of CC for us:
% scons
CC is: cc
A construction environment, however, is actually a Python object with associated methods, etc. If you want to have direct access to only the dictionary of construction variables, you can fetch this using the Dictionary method:
env = Environment(FOO = 'foo', BAR = 'bar') dict = env.Dictionary() for key, value in dict.items(): print "key = %s, value = %s % (key, value) |
This SConstruct file will print the dictionary items for us as follows:
% scons
key = FOO, value = foo
key = BAR, value = bar
<<< Previous | Home | Next >>> |
Copying Construction Environments | Up | Modifying a Construction Environment |