[Tutor] Closing and Open File--TkFileDialogs
kent37 at tds.net
Sat Feb 7 03:17:24 CET 2009
On Fri, Feb 6, 2009 at 6:53 PM, Wayne Watson
<sierra_mtnview at sbcglobal.net> wrote:
> I'm using asksaveasfilename, and, as I understand it, it returns the file
> name to me in write mode. I don't recall that there's a way to reference the
> file with only the filename. That is, there's no filename.write(). Comments?
I think you are confused between askopenfile() and askopenfilename().
The first opens the file and returns a file object, the second returns
just the file name and you open the file yourself.
> While I'm at it, I have found a good example program for TkFileDialog
> methods, but the description of them on the internet is pretty shallow. For
> example, An Intro to Tkinter, Lundh's Tkinter pages, NM Tech pdf files and
> Python docs have little to say.
This is helpful:
More information about the Tutor