-
Notifications
You must be signed in to change notification settings - Fork 0
/
Organize Files.py
59 lines (46 loc) · 1.37 KB
/
Organize Files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Going through files in a folder
# To move them into three new folders
import shutil
import os
# Moving file to Archive Folder
def archive(file_name):
shutil.move(old_files_path + "/" + file_name, archive_files_path)
# Moving file to New Folder (Stuff to keep)
def keep(file_name):
shutil.move(old_files_path + "/" + file_name, new_files_path)
# Moving file to "Think About It" Folder
def think_about_it(file_name):
shutil.move(old_files_path + "/" + file_name, think_about_it_path)
# File Paths
old_files_path = ""
new_files_path = ""
archive_files_path = ""
think_about_it_path = ""
# Options Lists (For Inputs)
archive_options = ["a", "arc", "archive", "n"]
keep_options = ["k", "keep", "y"]
# Main Loop
while True:
# List of all of the files in the folder
files = os.listdir(old_files_path)
# Getting a file to ask
cur_file = files[-1]
# Asking what to do with a file
ask = input(cur_file + ": ")
# Moving the file depending on
# what the input givin is
if ask in archive_options:
archive(cur_file)
print("archive")
elif ask in keep_options:
keep(cur_file)
print("keep")
else:
think_about_it(cur_file)
print("think about it later")
# Break from main loop if folder has 0 files
if len(files) <= 1:
break
else:
# Give a space between files
print()