def update_dropdowns(self, df):
# Update dropdown menus with unique areas from the DataFrame
self.areas = ["none"]
self.areas.extend( df[df.columns[1]].unique())
self.gui_components['area_dropdown_1'].clear()
self.gui_components['area_dropdown_2'].clear()
self.gui_components['area_dropdown_3'].clear()
print("mitte update dropdown")
for area in self.areas:
print("start for loop")
self.gui_components['area_dropdown_1'].addItem(area)
print("after_1")
self.gui_components['area_dropdown_2'].addItem(area)
print("after_2")
self.gui_components['area_dropdown_3'].addItem(area)
print("after_3")
All area dropdowns are created in exactly the same way. When this funciton is called the following is printed:
enter image description here
as you see it is called a lot but never prints the last statement and throws a maximum recursion depth error. Because of this i assumed that the error was in the last self.gui_components call.
Therefore I commented it out and it worked fully exept the one combo box was missing in the gui. But no errors. Weirdly all following codes work:
def update_dropdowns(self, df):
# Update dropdown menus with unique areas from the DataFrame
self.areas = ["none"]
self.areas.extend( df[df.columns[1]].unique())
self.gui_components['area_dropdown_1'].clear()
self.gui_components['area_dropdown_2'].clear()
self.gui_components['area_dropdown_3'].clear()
print("mitte update dropdown")
for area in self.areas:
print("start for loop")
self.gui_components['area_dropdown_1'].addItem(area)
print("after_1")
self.gui_components['area_dropdown_2'].addItem(area)
print("after_2")
#self.gui_components['area_dropdown_3'].addItem(area)
print("after_3")
def update_dropdowns(self, df):
# Update dropdown menus with unique areas from the DataFrame
self.areas = ["none"]
self.areas.extend( df[df.columns[1]].unique())
self.gui_components['area_dropdown_1'].clear()
self.gui_components['area_dropdown_2'].clear()
self.gui_components['area_dropdown_3'].clear()
print("mitte update dropdown")
for area in self.areas:
print("start for loop")
self.gui_components['area_dropdown_1'].addItem(area)
print("after_1")
#self.gui_components['area_dropdown_2'].addItem(area)
print("after_2")
self.gui_components['area_dropdown_3'].addItem(area)
print("after_3")
def update_dropdowns(self, df):
# Update dropdown menus with unique areas from the DataFrame
self.areas = ["none"]
self.areas.extend( df[df.columns[1]].unique())
self.gui_components['area_dropdown_1'].clear()
self.gui_components['area_dropdown_2'].clear()
self.gui_components['area_dropdown_3'].clear()
print("mitte update dropdown")
for area in self.areas:
print("start for loop")
#self.gui_components['area_dropdown_1'].addItem(area)
print("after_1")
self.gui_components['area_dropdown_2'].addItem(area)
print("after_2")
self.gui_components['area_dropdown_3'].addItem(area)
print("after_3")
with this output:
enter image description here
but in completion it does not work. I also tried this:
def update_dropdowns(self, df):
# Update dropdown menus with unique areas from the DataFrame
self.areas = ["none"]
self.areas.extend( df[df.columns[1]].unique())
self.gui_components['area_dropdown_1'].clear()
self.gui_components['area_dropdown_2'].clear()
self.gui_components['area_dropdown_3'].clear()
print("mitte update dropdown")
for area in self.areas:
print("start for loop")
self.gui_components['area_dropdown_1'].addItem(area)
print("after_1")
self.gui_components['area_dropdown_2'].addItem(area)
print("after_2")
#self.gui_components['area_dropdown_3'].addItem(area)
print("after_3")
self.update_last_dropdown(self.areas)
def update_last_dropdown(self,areas):
for area in areas:
self.gui_components['area_dropdown_3'].addItem(area)
This throws the same error as in the start.
Fabian Schwiers is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.