You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting the following message when trying to run a Python script invoking tkinter using the Exec method on PyScope object:
Traceback (most recent call last):
File "C:\Program Files\Python38\Lib\tkinter_init_.py", line 351, in del
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError
:
main thread is not in main loop
I am not spawning any threads in my script invoking tkinter. I get the crash if I click the Quit button or close the tkinter window with the 'X' in the top-right hand corner. The crash only happens after running the script and closing the window at least 7 or 8 times. I do not have to click the "Make Features" button to make the crash happen.
This discussion was converted from issue #2410 on July 02, 2024 16:52.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Environment
Details
I am getting the following message when trying to run a Python script invoking tkinter using the Exec method on PyScope object:
Traceback (most recent call last):
File "C:\Program Files\Python38\Lib\tkinter_init_.py", line 351, in del
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError
:
main thread is not in main loop
I am not spawning any threads in my script invoking tkinter. I get the crash if I click the Quit button or close the tkinter window with the 'X' in the top-right hand corner. The crash only happens after running the script and closing the window at least 7 or 8 times. I do not have to click the "Make Features" button to make the crash happen.
Here is the script text:
import tkinter as tk
from tkinter import ttk
allfeatures = ["Point","Line","Plane","Circle","Ellipse","Slot","Cylinder","Sphere","Cone","Torus","Paraboloid"]
#create window
window = tk.Tk()
global netfeaturetype
global numberval
def featurepress():
global netfeaturetype
global netnumberval
global netdoubleval
#set background color of window
window.configure(background="wheat1")
#set the title of window
window.title("Make Features")
#set window size
window.geometry("350x90")
featuretype = tk.StringVar()
numberval = tk.IntVar()
doubleval = tk.DoubleVar()
netfeaturetype = ""
netnumberval = 99
netdoubleval = 10.5
feature_label = tk.Label(window, text='Feature Type', background="wheat1").place(x=120, y=5)
combo_feature_entry = ttk.Combobox(window)
combo_feature_entry['values'] = allfeatures
combo_feature_entry.place(x=200, y=5)
combo_feature_entry.current(3)
number_label = tk.Label(window, text='Number', background="wheat1").place(x=120, y=40)
number_entry = tk.Entry(window, width=7, textvariable=numberval).place(x=200, y=40)
create_button = tk.Button(window, text='Create Feature', command= lambda: featurepress(),
height=2, width=11).place(x=5, y=5)
create_button = tk.Button(window, text='Quit', command=window.destroy,
height=1, width=9).place(x=5, y=50)
#start the GUI
window.mainloop()
Traceback (most recent call last):
File "C:\Program Files\Python38\Lib\tkinter_init_.py", line 351, in del
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError
:
main thread is not in main loop
All reactions