Opening files

Gordon McMillan gmcm at hypernet.com
Mon Aug 30 09:37:46 EDT 1999


rainer2207 at my-deja.com asks:

> How do I define a function to open a file using
> tkFileDialog.askopenfilename() and what do I have to import?

import tkFileDialog

fnm = tkFileDialog.askopenfilename(
                    filetypes=[("any file", "*")],
                    title="Chose or Lose")

- Gordon




More information about the Python-list mailing list