I am trying to modify an existing Excel file using the pandas library in Python.
i used the file contents for my automated email triggering the email to the customer
once the mail sent i just want to update the status of the customer in the excel file
is there a way to do this using pandas library in python?
subprocess.Popen('C:\\Program Files (x86)\\Microsoft Office\\Office15\\OUTLOOK')
time.sleep(10)
for i in range(0, len(DAYS_COUNT)):
if df['Acceptance status'][i] in NO_FOLLOWUP:
pass
if df['Days \ncount'][i] >= 7 and df['Platform'][i] == "Email":
time.sleep(3)
print(df['Company Name/ \nEmail Address'][i])
send_to = df['Company Name/ \nEmail Address'][i]
pyautogui.click(x=25, y=244) # sent_click
time.sleep(1)
pyautogui.click(x=118, y=158) # search_sent_click
time.sleep(1)
pyautogui.click(x=286, y=74) # search_by_to_click
time.sleep(1)
pyautogui.write(df['Company Name/ \nEmail Address'][i])
time.sleep(2)
# pyautogui.click(x=207, y=254) # first_item_click
pyautogui.click(x=186, y=276) # first_item_click
time.sleep(1)
pyautogui.click(x=639, y=162) # forward_click
time.sleep(1)
pyautogui.write(f"{send_to};") # to_address
time.sleep(5)
pyautogui.press("tab")
pyautogui.write(f"{CC};") # cc_address
time.sleep(5)
pyautogui.press("tab")
pyautogui.tripleClick(x=607, y=252) # subject_line_remove_existing
subject_status = df['Acceptance status'][i].lower()
pyautogui.write(MAIL_SUBJECT[subject_status]) # subject
time.sleep(5)
pyautogui.press("tab")
pyautogui.press("tab")
mail_body_status = df['Acceptance status'][i].lower()
if df['Remarks'][i] == "economic times":
pyautogui.write(BD_FRESH_MAIL['economic_mail_body'])
else:
pyautogui.write(MAIL_BODY[mail_body_status]) # mail_body
time.sleep(5)
# pyautogui.press("delete")
# pyautogui.press("delete")
pyautogui.click(x=489, y=205) # send_click
time.sleep(1)
once the mail sent i just want to update the status of the customer in the excel file
and save it without losing the data in the excel file