I have the following script that will run each script (sequentially) in a directory:
import os directory = [] for dirpath, dirnames, filenames in os.walk(\
x is local to the script1 function, so it's not visible in the outer scope. If you put the code inside script1 at the top level of the file, it should work.
x
script1