Python Forum
Problem with updating file to attach/pynput
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with updating file to attach/pynput
#7
No, the problem is the while True. You never recreate the file attachment, you never re-open the file, you never build a new email. You open the file once, when the script starts, and then never look at it again.

The easiest solution, would be to move the while True to be the first line of the function, so you rebuild the email each time you want to send it.
Reply


Messages In This Thread
RE: Problem with updating file to attach/pynput - by nilamo - Oct-27-2018, 09:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unexpected output when trying to attach files in a mail application PythonU2Novel 0 403 May-17-2024, 02:59 AM
Last Post: PythonU2Novel
  Problem with "from pynput" LFreitas 1 324 Mar-24-2024, 02:23 AM
Last Post: deanhystad
  Python openyxl not updating Excel file MrBean12 1 503 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Updating sharepoint excel file odd results cubangt 1 1,017 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  Pynput - One content on screen, another in the variable Valjean 4 1,201 Sep-18-2023, 06:00 PM
Last Post: Valjean
  Pynput Library not Working with Windows jacknewport 1 2,528 Mar-26-2022, 07:09 PM
Last Post: snippsat
  Initializing, reading and updating a large JSON file medatib531 0 1,883 Mar-10-2022, 07:58 PM
Last Post: medatib531
  Updating a config file [solved] ebolisa 8 2,735 Nov-04-2021, 10:20 AM
Last Post: Gribouillis
  Problem updating value in MySQL database dangermaus33 1 1,714 Nov-24-2020, 08:32 PM
Last Post: dangermaus33
  Is it possible to attach to an open existing Browser? tommytx 7 3,238 Apr-27-2020, 12:40 AM
Last Post: tommytx

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020