Reputation: 584
I have a student on MacOS (Sonoma 14.6.1) getting an error when they try to create a window in a function:
def nothing_window():
window = tkinter.Tk()
window.mainloop()
When they call that function in IDLE, they get an error about not having the correct permissions to call the Tk constructor. Here's the traceback:
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
nothing_window()
File "/Users/<username>/Documents/<coursename>/<student_file>.py", line 232, in nothing_window
window = tkinter.Tk()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2346, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: error getting working directory name: not owner
This problem is also unfortunately preventing them from using the turtle package.
Is there anything they can do so they can use Tkinter in python programs run from IDLE?
Upvotes: 0
Views: 53