Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import os, sys, fnmatch
  3. mask = '*.tpl'
  4. string = '\n<!--{$smarty.template}-->'
  5. def walk(arg,dir,files):
  6.    for file in files:
  7.      if fnmatch.fnmatch(file,mask):
  8.         name = os.path.join(dir,file)
  9.         try:
  10.           data = open(name,'a').write(string)
  11.           print name
  12.         except:
  13.             pass    
  14. os.path.walk('.',walk,[])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement