Taz bisounours-codeur | euh le backquoute c'est pareil que le $()
en attendant, j'utilise ça
Code :
- def chmod(void, dirname, names):
- import os, stat
- for name in names :
- fullpath=os.path.join(dirname, name)
- mode=os.stat(fullpath)[stat.ST_MODE]
- if stat.S_ISDIR(mode):
- os.chmod(fullpath, 0500)
- elif stat.S_ISREG(mode):
- os.chmod(fullpath, 0400)
- if __name__=='__main__':
- import sys, os
- for dir in sys.argv[1:]:
- os.path.walk(dir, chmod, None)
|
|