import win32com.client as client
import pathlib
Initialize the application
import tkinter | |
def tearoff_callback(menu, tearoff): | |
"""Move the tearoff menu after tearoff""" | |
root.update() | |
x = root.winfo_x() - 75 | |
y = root.winfo_y() | |
root.tk.call('wm', 'geometry', tearoff, f'+{x}+{y}') | |
root = tkinter.Tk() |
""" | |
Window that fades in an out at a specified time interval and increment | |
Author: Israel Dryer | |
Modified: March 29, 2021 | |
""" | |
from tkinter import ttk | |
import tkinter | |
import sys | |
from datetime import datetime | |
class GoogleNewsScraper(): | |
def __init__(self): | |
self.date_modified = datetime.today() | |
def scrape(self): |
search_term = "product" | |
for message in inbox.Items: | |
if search_term in message.Subject: | |
do_something() | |
break # this will break out of the loop once the item is found |
import csv | |
import requests | |
from bs4 import BeautifulSoup | |
stock = ['AMZN','AXP','AAPL','AXTA','BAC'] | |
# create csv writer | |
f = open("data_file.csv", "w", newline="", encoding="utf-8") | |
writer = csv.writer(f) | |
# add header to csv file |
Welcome to a series of tutorials on how to get the most out of Microsoft Outlook using python! | |
<table> | |
<tr> | |
<td> | |
<ul><b> | |
<li><a href="https://github.com/israel-dryer/Outlook-Python-Tutorial/wiki">Home</a></li> | |
<li><a href="https://github.com/israel-dryer/Outlook-Python-Tutorial/wiki/Getting-started">Getting started</a></li> | |
<li><a href="https://github.com/israel-dryer/Outlook-Python-Tutorial/wiki/Plain-text-email">Plain text email</a></li> | |
<li><a href="https://github.com/israel-dryer/Outlook-Python-Tutorial/wiki/HTML-formatted-email">HMTL formatted email</a></li> |
""" | |
Add members to an existing user distribution list in Python | |
https://docs.microsoft.com/en-us/office/vba/api/outlook.mailitem.recipients | |
https://docs.microsoft.com/en-us/office/vba/api/outlook.distlistitem.addmembers | |
https://docs.microsoft.com/en-us/office/vba/api/outlook.oldefaultfolders | |
""" | |
import win32com.client as client | |
# start an instance of outlook |
import re | |
import win32com.client as client | |
# pattern for identifying email addresses | |
pattern = re.compile(r'mailto:(\w+\.\[email protected])') | |
outlook = client.Dispatch('Outlook.Application') | |
namespace = outlook.GetNameSpace('MAPI') | |
inbox = namespace.Folders['Inbox'] |
""" | |
Create a html formatted list from a python list | |
""" | |
# email template with curly braces to insert list | |
email_template = ''' | |
<p>Hello, here are the items that you ordered:<br> | |
{} | |
</p> | |
''' |