aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar gimpei <gim.kobayashi@gmail.com> 2017-08-13 23:16:41 +0900
committerGravatar gimpei <gim.kobayashi@gmail.com> 2017-08-13 23:16:41 +0900
commit54ddab01d23ed7c0e4a43657c342342241090963 (patch)
treeb4f4cf2ec2423df856c3572d21ceabc1ffde265d
parent9953fbc4cabc92e3bbf5a85f6dbc6fefc167b6c5 (diff)
downloadkawaii-term-54ddab01d23ed7c0e4a43657c342342241090963.tar.gz
add explosion
-rwxr-xr-xbin/explosion34
-rw-r--r--bin/tmp/10
-rw-r--r--bin/tmp/20
3 files changed, 34 insertions, 0 deletions
diff --git a/bin/explosion b/bin/explosion
new file mode 100755
index 0000000..8a9aff1
--- /dev/null
+++ b/bin/explosion
@@ -0,0 +1,34 @@
+#!/usr/bin/python3
+import os
+import sys
+import glob
+import time
+import shutil
+
+HOME = os.environ['HOME']
+PWD = os.environ['PWD']
+target = sys.argv[1]
+
+# めぐみんを出力して全部中身を消す
+print( open('{HOME}/kawaii-term/asciiarts/megumin.ascii'.format(HOME=HOME)).read() )
+
+print( '詠唱を開始します' )
+start = time.time()
+files = glob.glob('{}/{}'.format(PWD, target))
+length = len( files )
+print( '詠唱を完了しました!{}[sec]'.format( int( time.time() - start) ) )
+
+for e, name in enumerate(files):
+ if e%500 == 0:
+ print('now iter {} / {}'.format(e, length) )
+ try:
+ os.remove( name )
+ except Exception as e:
+ try:
+ shutil.rmtree( name )
+ ...
+ except Exception as e:
+ print( e )
+ ...
+print( '爆破完了!!' )
+
diff --git a/bin/tmp/1 b/bin/tmp/1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bin/tmp/1
diff --git a/bin/tmp/2 b/bin/tmp/2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bin/tmp/2