Assuming that you have a shell script on the path in *nix and a batch file with the same name in Windows, such as pybot and pybot.bat (assuming you can't use the -m robot.run), is there a way to invoke it that works on *nix and Windows
without switching on
os.name or anything like that?
Here's what I've tried:
subprocess.call(['pybot','-h'], shell=False) #fails on Win32 b/c its a bat not an exe (WindowsError: [Error 2] The system cannot find the file specified)
subprocess.call(['pybot.bat','-h'], shell=False) #works on windows but fails on Linux for obvious reasons
subprocess.call(['pybot','-h'], shell=True) #works on Windows, but executes on Linux with no arguments passed to pybot
Thanks,
Kevin