Created
January 21, 2014 07:38
-
-
Save kanghyojun/8535803 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from os import walk, path | |
| from sys import argv | |
| from subprocess import call | |
| from threading import Timer | |
| from time import ctime | |
| path_ = u'/home/hyojun/src/a' | |
| def remove_file(): | |
| global path_ | |
| print 'removing files at %s' % ctime() | |
| for r, _, p in walk(path_): | |
| for p_ in p: | |
| call(['rm', path.join(r, p_)]) | |
| Timer(5, remove_file).start() | |
| if __name__ == '__main__': | |
| remove_file() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment