新军's profileIns'PhotosBlogListsMore Tools Help

Blog


    January 20

    小工具之Taka_Editplus_Baks_Cleanup

    Editplus总是自动生成baks文件.
    写了个小工具,方便日常使用.并通过py2exe打包成了exe文件
    py源码:
    #!/usr/bin/env python
    #-*-coding:gbk-*-
    import os
    import sys
    import glob
    path = raw_input('path: \n')
    def walk_dir(dir, topdown=True):
        counter = 0
        for root, dirs, files in os.walk(dir, topdown):
            for name in files:
                realpath = os.path.join(root, name)
         if realpath[-4:] == '.bak':
             os.remove(realpath)
      counter += 1
        print 'total removed ' + str(counter) + ' files.\nThanks.\nAuthor: Ins\nTaKa-Studio(http://TaKa-Studio.appspot.com)'
    walk_dir(path)
    raw_input('press Enter key to exit')

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://atizu.spaces.live.com/blog/cns!770045E52BB97DD2!230.trak
    Weblogs that reference this entry
    • None