Aug-07-2023, 11:34 AM
(This post was last modified: Aug-07-2023, 02:23 PM by deanhystad.)
(Aug-04-2023, 07:11 PM)deanhystad Wrote: This program contains an error
import tkinter as tk from tkinter import filedialog path = filedialog.askopen()There is not a filedialog.askopen() function
Error:AttributeError: module 'tkinter.filedialog' has no attribute 'askopen'
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.
Use Python tags, not Code tags. I don't know why there are code tags. They don't do anything.