I know you can run Linux terminal commands through Python scripts using subprocess
subprocess.call(['ls', '-l']) # for linux
But I can't find a way to do the same thing on windows
subprocess.call(['dir']) # for windows
is it possible using Python without heavy tinkering?
Should I stick to good old fashioned batch files?
ipconfigis a Windows command. This should work (and it does on my computer).check_output("ipconfig")shell=Truecheck_output("ipconfig",shell=True)dir. You need to run the command process itself:'cmd.exe /c dir'. Edit: or do as @PadraicCunningham suggests.os.listdiror maybeglob.globrather than shelling out to do adir.