How to detect if a file is executable on Windows?

jureq jureq at nowhere.no
Tue Feb 19 08:58:18 EST 2019


> I could also use the 2 first bytes of a file and determine if the file
> is a binary because on Windows, the executable files start with b'MZ'.

Is .bat executable? 



More information about the Python-list mailing list