Q:

Run a script that moves director in the terminal

In a terminal I can move around simply using:
cd [file path]

However I need a script that does this automatically as I need to go into a a bunch of folders (around 200) and run a programme in each one.
So far I've tried things like shutil.move() which does not do what I need as that move the entire folder my code is in, including my IDE which causes my programme to crash.
Is there any way to run a script in python that opens up a terminal shell, navigates to a folder via a file path and then executes a programme when in that folder?

A:

So for this, you could use the os module. Then do this:
for dir in os.listdir():
    if os.path.isdir(dir):
        os.chdir(dir)
        # Then do whatever program you wish to run

