os模块

#path in windows

a='d:/dev/cygwin'

b = os.path.normpath(a)   #'d:\\dev\\cygwin'

 

#decide file mode

statinfo = os.stat(fullpath)
if statinfo.st_mode&stat.S_IEXEC:

  print 'executable'

else:

  print 'not executable'

你可能感兴趣的:(windows,OS)