for f in ['abc.py', ..., 'xyz.py']:
exec(open(f).read())
exec
will execute the given str
ing as Python code.
If you do
for m in ['abc', ..., 'xyz']:
exec('import ' + m)
your files are import
ed as modules, however, inside a scope of each for
loop. So you cannot use functions outside the loop.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…