0

Lets say I have a document file named sample.docx added to an IDE python project. I have a python tkinter program and I want the user to be a able to click a button that will automatically open the sample.docx file. I think the only way is by opening the windows save as window with the file already loaded.

How do I do this?

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
idroid8
  • 177
  • 1
  • 4
  • 14
  • I'm not clear on why you believe that you're supposed to open a file by saving it (specifically from its default application's "Save As..." dialog, for some reason), but it doesn't work that way. – TigerhawkT3 Jan 25 '16 at 05:20
  • As in they press a button and the "save as" dialog pops up with the file samle.docx already loaded. – idroid8 Jan 25 '16 at 05:37
  • Then you need [this](http://stackoverflow.com/questions/7094324/how-to-use-python-saveas-dialog) and some [documentation](http://effbot.org/tkinterbook/tkinter-file-dialogs.htm). Please do additional independent research. – TigerhawkT3 Jan 25 '16 at 05:51
  • with open('sample.docx') as f: process(f) – Terry Jan Reedy Jan 25 '16 at 07:26

0 Answers0