Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. ya = ''' Metrika counter '''
  2.  
  3. names = [name for name in os.listdir(os.getcwd()) if name[-3:] == "htm"]
  4.  
  5. for curr_name in names:
  6.     print curr_name
  7.     data = []
  8.     with open(curr_name) as f:
  9.         data = f.readlines()
  10.     for i in xrange(len( data)):
  11.         data[i] = data[i].replace("</body>", ya + "</body>")
  12.     with open(curr_name, "w") as f:
  13.         f.writelines(data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement