xushaoxun 发表于 2013-1-28 19:44:45

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'
页: [1]
查看完整版本: os模块