Last active
December 29, 2017 11:22
-
-
Save ChamodDamitha/099e8c27d65b48e478e9dfc28b0bccdb to your computer and use it in GitHub Desktop.
Revisions
-
Chamod Damitha Samarajeewa revised this gist
Dec 29, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,6 @@ files = [f for f in os.listdir('.') if os.path.isfile(f)] for f in files: ext = f.split('.')[-1] dirr = 'Chategorized/' + ext + "-files" if ext not in types: -
Chamod Damitha Samarajeewa created this gist
Dec 29, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ import os from shutil import copyfile types = [] files = [f for f in os.listdir('.') if os.path.isfile(f)] for f in files: # do something ext = f.split('.')[-1] dirr = 'Chategorized/' + ext + "-files" if ext not in types: if not os.path.exists(dirr): os.makedirs(dirr) copyfile(f, dirr + '/' + f)