From e49200a383c9ec6fe1a2c4eba9da2548f9533e07 Mon Sep 17 00:00:00 2001 From: ludwig Date: Mon, 27 Jun 2022 09:51:45 -0500 Subject: [PATCH] Upload files to '' --- main.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..3de8dda --- /dev/null +++ b/main.py @@ -0,0 +1,43 @@ +import os + + +def main(): + + exts = ('.jpg', '.webm', '.png', '.mp4', '.gif', '.pdf', '.odt') + + print("The Source directory is " + os.getcwd()) + newdir = str(input("Please enter a directory:")) + + if not os.path.isdir(newdir): # Checks if directory exists + print("Directory does not exist") + + + else: + directory = os.path.join(os.getcwd(), newdir) # If true, sets directory to new dir, and changes dir + os.chdir(directory) + print("Directory found " + os.getcwd()) + # file_list=glob.glob('*.png') #checks to see if files are in directory, asks user if they look familiar + frecognize(directory, exts) + + +def frecognize(directory, exts): + file=[] + #i = 0 + #while i < 3: + for file in os.listdir(directory): + + if file.endswith(exts): + print(file) + #i += 1 + + +def frename(directory): + str(oldname) + newname = str(input("Please enter the new filename: ")) + + for file in os.listdir(directory) + +main() + +# todo add gui +# todo make frecognize do what the fuck I want it to (print x amount of files) \ No newline at end of file