Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Script Execution Email Notifier

Author: WGM Date: 2025-10-01

This script sends email notifications upon the completion or failure of your Python scripts.

Setup Instructions

Follow these steps to configure and use the script:

  1. Set Environment Variables in VS Code: Open your settings.json file (Ctrl+Shift+P -> type Preferences: Open User Settings (JSON)). Paste the following into your settings, replacing the placeholders with your actual email credentials:

    {
    "...some existing settings...": "...",
    "terminal.integrated.env.windows": {
    "EMAIL_USER": "gmail address you want to send from",
    "EMAIL_PASS": "app password you generated from gmail (go to google account -> security -> app passwords (need 2-step verification enabled))",
    "EMAIL_TO": "gmail address you want to send to"
    }
    }
  2. Import the Module: At the top of any Python script you want this functionality to apply to (ensure it is inside the same folder), add the following lines:

    importnotify_on_finishnotify_on_finish.setup()
  3. Restart VS Code: Close and reopen VS Code to ensure the new environment variables are loaded into your integrated terminal.

  4. Run Your Script: Daar vat hy. Run your script as usual. You will receive an email when it finishes or crashes.


Extras

  • Terminal Output Logging: Set line 36 (in notify_on_finish.py) to False if you do not want to save and send the complete terminal output, and only want a brief email notification on finish/failure.

About

Lightweight Python utility that sends email notifications when long-running scripts finish or crash.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages