I'm wondering if anyone knows how to use askopenfiles() from tkinter.filedialog to move a file to another folder? If so can I have an example
Asked
Active
Viewed 198 times
-2
-
What code do you already have? `askopenfile` puts up a dialog that asks the user to choose a file. That's all it does. It doesn't do any moving. You have to do that yourself. – Tim Roberts Aug 04 '21 at 23:39
-
https://stackoverflow.com/questions/8858008/how-to-move-a-file-in-python does this answer your question? – Kaia Aug 04 '21 at 23:42
-
I know tried getting the file with askopenfile() and moving it with os but nothing works @Keon – Zinnedd Aug 04 '21 at 23:50
-
Please show what you've tried. Your question is unclear since there are countless examples on the internet for how to use `askopenfile`. – Bryan Oakley Aug 05 '21 at 00:52
-
Stack Overflow is not intended to replace existing tutorials and documentation, and is not a discussion forum. The way to answer your question is to put something like `tkinter askopenfile` into a search engine; and if you don't understand what is written there, you should try asking somewhere like Reddit or Quora unless you have a *specific* question with a code example. – Karl Knechtel Aug 05 '21 at 01:08
1 Answers
0
Nevermind I was using the wrong function, askopenfile() does not working with moving funtions in os such as os.rename or shutil.move, I had to use askopenfilename() instead so it looks like this.
def getv():
shutil.move(str(askopenfilename()), 'C:\\Users\\ezedd\\OneDrive\\Desktop\\Python Projects\\Converter')

Zinnedd
- 1
- 1