Advertisement
Guest User

Untitled

a guest
Aug 8th, 2017
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import os;
  2. import sys;
  3.  
  4. filePathSrc = notepad.prompt('Enter the path to the folder where the files are located', 'Convert files to UTF-8', 'C:\\Temp\\UTF8');
  5.  
  6. if filePathSrc is not None and len(filePathSrc) >= 4:
  7.     for root, dirs, files in os.walk(filePathSrc):
  8.         for fn in files:
  9.             if fn[-4:] == '.php' or fn[-4:] == '.htm' or fn[-5:] == '.html':
  10.                 notepad.open(root + "\\" + fn)
  11.                 console.write(root + "\\" + fn + "\r\n")
  12.                 notepad.runMenuCommand("Encoding", "Convert to UTF-8")
  13.                 notepad.save()
  14.                 notepad.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement