Opening files

Gordon McMillan gmcm at hypernet.com
Mon Aug 30 15:37:46 CEST 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