
Pythonで
・ファイルを移動
できます!
コード
ここでは例として
・デスクトップ配下のファイル「aiueo.txt」を移動
させます。
※デスクトップ上に下記コードを記載した「sample.py」を作成します。

import shutil
# 移動させるファイルのファイルパス
file_path = r'C:\Users\lunch\Desktop\aiueo.txt'
# 移動先のフォルダ
to_folder_path = r'C:\Users\lunch\Desktop\folder_001'
try:
# ファイルを移動
shutil.move(file_path,to_folder_path)
except Exception as e:
print(e)
実行結果
ファイルを移動できました。


参考
上記で使用した以下の詳細は、公式サイトをご確認ください。
●標準ライブラリ「shutil」モジュールの「move」