I have the code below :
def update_contact_from_crm_to_import_in_365():
sql = "SELECT * FROM CRM_PRIMARY WHERE copy_to_365 = 'To update' ORDER BY CRM_PRIMARY.id DESC"
search_result = my_cursor.execute(sql)
search_result = my_cursor.fetchall()
sql_result.clear()
sql_result.append(search_result)
Filter(sql_result[0])
# Get id of sql result to pass them
list_get_selected_id.clear()
for res in (sql_result):
for id in (res):
list_get_selected_id.append(id[0])
time.sleep(5)
validate1 = messagebox.askquestion("Update ?", "Launch update ?")
if validate1 == 'yes':
open_dynamics_365_full_contact_list()
My problem is that the Filter(sql_result[0])
seems to start at the very end of the update_contact_from_crm_to_import_in_365
function (after the messagebox
)
So far, when i call update_contact_from_crm_to_import_in_365()
it display the messagebox and once it has been answered then it call Filter()
.
But i would like to call Filter
, wait 5 secondes for Filter to proceed and end, and then display the messagebox.
How do i do that please ?
I read about Threading but i'm just a beginner in Python so it's a bit complicated for me to get it yet.
Thanks in advance