The ipad goodreader to JS file support is not very good, although can read it but always unable to exit, not return to the GoodReader of the main interface, so I need to turn the JS file batch into plain text. For this purpose, I've got one of the following small apps:
Copy Code code as follows:
#-*-Coding:utf-8-*-
Import OS
def rename ():
Path = raw_input (Please enter folder path to process)
Print path
Old_ext = "." +raw_input ("Please enter the file type to be processed")
Print Old_ext
New_ext = "." +raw_input ("Please enter the file type you want to become")
Print New_ext
For (path, dirs, files) in Os.walk (path): #遍历目录树
For filename in Files:
ext = os.path.splitext (filename) [1] #取得文件类型, notice it's got a dot.
Print ext;
if (ext = = Old_ext):
Print "----------------"
newname = Filename.replace (Old_ext, New_ext)
OldPath = path + "\" + filename
NewPath = path + "\" + newname
Try
Os.rename (OldPath, NewPath)
Except Baseexception, E:
Print (str (e))
if __name__ = = ' __main__ ':
Rename ()