How to move all only one type of file to another directory? For example, i want to move only all .jpg only file to another folder in Python. I know batch is easier to do it, but i prefer in Python. Anyone can help?

in java i use new File(Folder path + "."); to list all files u can try (Folder path + ".jpg")

I would use os.listdir, and shutil.move (or copy). Here's a useful function to sort by extension:

def filterbyext(filelist,ext):
    """Returns all files of type ext in filelist"""
    returnfiles = []
    for item in filelist:
        x = item.split(".")
            #Take all files of THIS type
            if str(x[1]) == ext:
        except IndexError:
    return returnfiles

So this is what it would look like:

for jpg in filterbyext(os.listdir(os.getcwd()),'jpg'):