Python Forum
[Tkinter] File Chooser will not close
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] File Chooser will not close
#7
(Aug-04-2023, 07:11 PM)deanhystad Wrote: This program contains an error
import tkinter as tk
from tkinter import filedialog

path = filedialog.askopen()
Error:
AttributeError: module 'tkinter.filedialog' has no attribute 'askopen'
There is not a filedialog.askopen() function

I don't use spyder, so I don't know if it works well with tkinter. I do know IDLE does not play well with tkinter. Mostly works, but not really.

Try running your program from the command line to see what happens.

What Python are you using? What version of Spyder?

Am sorry for that I accidently left the rest of the function name out. Please see below for modified code and output.

[Code:]

import tkinter as tk
from tkinter import filedialog

path = filedialog.askopenfilename()
[end code]

output window looks like this:

In [2] path = filedialog.askopenfilename()

r\n\r\n
r\n\r\n
r\n\r\n
r\n\r\n
r\n\r\n
...
[End output]

The code works in the sense that it does open a file window, I can select the file I want and it stores it into the "path" variable correctly. My problem is that it starts generating the "r\n\r\n" and it wont let me process any more code. As if something loop is still running, the kernel indicator shows a busy status.

Regarding the version info I am running Spyder IDE 5.2.2 with Py 3.9.13
deanhystad write Aug-07-2023, 02:23 PM:
Use Python tags, not Code tags. I don't know why there are code tags. They don't do anything.
Reply


Messages In This Thread
File Chooser will not close - by noob82 - Aug-04-2023, 03:32 AM
RE: File Chooser will not close - by Gribouillis - Aug-04-2023, 05:29 AM
RE: File Chooser will not close - by noob82 - Aug-04-2023, 12:30 PM
RE: File Chooser will not close - by deanhystad - Aug-04-2023, 11:40 AM
RE: File Chooser will not close - by noob82 - Aug-04-2023, 12:28 PM
RE: File Chooser will not close - by deanhystad - Aug-04-2023, 07:11 PM
RE: File Chooser will not close - by noob82 - Aug-07-2023, 11:34 AM
RE: File Chooser will not close - by deanhystad - Aug-07-2023, 02:25 PM
RE: File Chooser will not close - by noob82 - Aug-09-2023, 02:08 PM
RE: File Chooser will not close - by noob82 - Aug-14-2023, 03:06 PM
RE: File Chooser will not close - by deanhystad - Aug-09-2023, 04:31 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020