I’m developing a python widget using tkinter where I need a button which will operate like any of the open button we see today. Basically I want it to help users to browse a file, select it and click ok. What i want is , as soon as the user clicks ‘ok’, it’ll copy the file from that location and save it into a particular location in a particular name, which will be then used by rest of my widget.
Thanks in advance.
Take a look at the various widgets in tkFileDialog. They could be very useful. Particularly, you might want
askopenfilenamewhich will pop up a dialog where you can browse for a particular file — When the user hitsOKit returns a filename which you can do whatever you want with.