Skip to content
← Back to Community
It is not moving txt files to destination
Profile icon
JonthueMichel

Using Python 3 on my local machine. The purpose is to sort and move txt files from the selected source and destination directory. Attached is the source code.

Voters
Profile icon
TharwatNazeah
Profile icon
JonthueMichel
Comments
hotnewtop
Profile icon
a5rocks

I think this line of code is to blame:
shutil.move(getSourcePath, destination_Folder)

Two things:

  • getSourcePath doesn't seem to be a thing?
  • shutil.move is used like this: shutil.move('path/to/file.txt', 'new/path/to/file.txt') (for example)
Profile icon
JonthueMichel

We'll this is a variable containing path from askdirectory, how else would you get the [email protected]