Many useful constructs in the previous script:
[float(arg) for arg in sys.argv[1:]]
builds a list of real numbers
from all the command-line argumentsfailure = os.system(cmd)
runs an operating system command
(e.g., another program)sys.exit(1)
aborts the program['%s_%s.png' % (method, dt) for dt in dt_values]
builds a list of
filenames from a list of numbers (dt_values
)montage
commands for creating composite figures are stored in a
list and thereafter executed in a loopglob.glob('*_*.png')
returns a list of the names of all files in the
current folder where the filename matches the Unix wildcard notation
*_*.png
(meaning "any text, underscore, any text, and then `.png`")os.remove(filename)
removes the file with name filename