converting batch files to python