I have one list with directories. I need to go each directory of a list and execute some command. like this I need to process entire list. But after first iteration it is throwing OSError. Please find the below code and help me.
CODE: ls_2 = ['build', 'flexiserver', 'fvntools', 'gbuild', 'sample'] for dir in ls_2: print ("Inside for loop") os.chdir(dir) ls_2 = os.listdir('.') print ("Inside dir %s %s" %(dir, ls_2)) subprocess.call('buildme.sh')