I know this may sound really stupid, but how can I move a file in a directory a user browsed to ( I named mine filedir) to the current directory I am in?
for example: I have a file called "pages.html" in "C:\webs". How can I move that file to the current working directory "."?
This is my code:
shutil.move(filedir, "*.*")
#I got errors using this code..
Is there another way to say current directory, other than "." ?
The second argument of shutil.move
specifies a directory, not a glob mask:
import os.path
shutil.move(os.path.join(filedir, "pages.html"), os.getcwd())
should work.