How by using python I can open cmd in the path i need and run a command

I have 2 folders in my directory: time0 and time1. I need to write a script in python what will have an endless loop- so that every 10 min I'm entering a different folder (time0/1) using cmd and writing in the cmd a command ("terraform init")

I was able to open the cmd using os.system("start cmd") but I cant go forther to the folder I need and write the "init" function.

any ideas?

1 answer