I need to run several commands more than 400 times for a mass number of files. Therefore, I'm trying to incorporate the commands in to a python script to automate the processes. Even though the commands run successfully in the the windows command prompt (I have manually tested the commands), they do not run successfully in python using os.system module as below.
import os
os.system('command')
For some commands such as 'cd' or 'dir', I get 0 for the exit code. For other commands I am getting 1 or 2 for the exit code (sometimes I get both). As I understand it 0 indicates success and 1 or 2 means the process failed.
Any suggestions? Thanks in advance....