Inside my GUI-Demo (qtpy
and QtCreator
) there's a QComboBox
connected to a QPushButton
.
Pressing the button opens my database and copies the data to my dataframe (pandas
).
Afterwards, I am trying to pass the unique data from one of my columns into a list—which is added to my ComboBox
.
Printing my dataframe in between tells me that it's filled correctly and I tried these lines of code in a few other places inside my program. But in this case it won't work and Python returns an error: Process finished with exit code -1073740791 (0xC0000409)
:
def pushTheButton(self):
df = pd.DataFrame()
try:
db = pymysql.connect("localhost", "testuser", "test123", "database_test")
cursor = db_load.cursor()
sql_query = "SELECT * FROM database_favorites_db"
cursor.execute(sql_query)
db.commit()
df = pd.read_sql(sql_query, db)
except:
db.rollback()
db.close()
list_unique = df.description.unique()
self.ui.cBoxFavorites.addItems(listing_unique)
Why is this error being returned and how can I fix it?
User contributions licensed under CC BY-SA 3.0