我有3個文件夾Folder A (Landing Folder)Folder B (Deletion Folder)Folder C (Transfer to AWS Folder)我已經編寫了一些 python 代碼,以便在進行一些數據轉換后將文件從登陸文件夾移動到登陸文件夾 - 我需要為文件制作一個決策樹: Check each filename in folder A to see if it exists in the database if the file exists already: move the file to Folder B Else Insert the file name into the Database & move the file to Folder C for transfer to AWS 我在 python 中測試并運行了 SQL 語句,但我不確定如何將文件移動到它們各自的文件夾。我假設我需要一些類似使用 shutil.move 到文件夾 B 或 C 的方法,具體取決于結果,但不能 100% 確定到達那里的語法。任何幫助表示贊賞。
如果數據庫中存在文件夾A中的文件名移動到文件夾B,如果文件不存在
慕的地6264312
2023-01-04 15:32:47