I've implemented a browse button in my program. Now, I'm wondering how i can take that file the user browsed for, and gain it's location/"file path" on the user's system.
So basically, the user browses for an image file, and then i want to move that image to a new folder in the program's directory, called "import". I plan to do so using command prompt, with a copy command. I just don't know how to code the event for the browse button. can you guys give me a simple code to use for this scenario?
In a wxPython wxFrame:
dialog = wx.FileDialog(
self, "Choose some files...", self._defaultDirectory, "",
"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif", wx.FD_OPEN|wx.FD_MULTIPLE)
if dialog.ShowModal() == wx.ID_OK:
paths = dialog.GetPaths()
dialog.Destroy()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With