I want to move all text files from one folder to another folder using Python. I found this code:
import os, shutil, glob
dst = \'/path/to/dir/Caches/com.app
For example, if I wanted to move all .txt files from one location to another ( on a Windows OS for instance ) I would do it something like this:
import shutil
import os,glob
inpath = 'R:/demo/in'
outpath = 'R:/demo/out'
os.chdir(inpath)
for file in glob.glob("*.txt"):
shutil.move(inpath+'/'+file,outpath)