I have script that downloads a file from a site and is saved into my downloads folder. I want to change the name of that file and move it to new folder. I already have code that generates the new filename, but i'm not sure how to take it into effect. This is what I have:
newfile_name='generated from user input'
os.listdir("C:\Users\qzh14\Downloads")
os.rename("originalfile","newfile_name")
shutil.move("CurrentFolder", "NewFolder")
I'm not sure if that's your full code, but I would use the rename method of os.
Tell me if I've missed anything. I'm relatively new to Python but I've been doing similar work. Hope this helps :)
Update: Searching for a file If you want to select a file from the available files, you can look at which files are there an manually enter the file you want. Something like this: