This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from datetime import datetime | |
class GoogleNewsScraper(): | |
def __init__(self): | |
self.date_modified = datetime.today() | |
def scrape(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Author: Israel Dryer | |
Modified: 2021-04-16 | |
Here's a simple example of creating a new theme with a single custom widget - a modern looking radiobutton. | |
In this example, I used a dictionary of settings. However, you can just as well do it with the Style.map, | |
Style.layout, and Style.configure methods. But, if you're going to build an entire theme, then using a settings | |
dictionary is more scalable, and could technically be stored in an offline json file as well. | |
""" | |
from PIL import ImageDraw, Image, ImageTk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32com.client as client | |
outlook = client.Dispatch('Outlook.Application') | |
namespace = outlook.GetNameSpace('MAPI') | |
inbox = namespace.GetDefaultFolder(6) | |
# search for messages meeting a specific criteria | |
target_messages = [item for item in inbox.Items if 'product' in item.Subject] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from tkinter import ttk | |
from PIL import Image, ImageTk, ImageDraw | |
class Gauge(ttk.Label): | |
def __init__(self, parent, **kwargs): | |
self.arc = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from tkinter import ttk | |
def submit(source, dest): | |
"""Collect data from source text and insert into destination text""" | |
text = source.get('1.0', 'end') | |
dest.insert('end', text) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
from PIL import ImageGrab | |
class Screenshot: | |
def __init__(self, parent, filename): | |
self.parent = parent | |
self.parent.bind("<Insert>", self.get_bounding_box) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from PIL import Image, ImageTk, ImageDraw | |
from tkinter import StringVar, IntVar | |
from tkinter import ttk | |
from tkinter.ttk import Frame | |
class NeedleMeter(Frame): | |
def __init__(self, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from tkinter import ttk | |
from PIL import Image, ImageDraw, ImageTk | |
def sizegrip_style(background, foreground): | |
"""Create style configuration for ttk sizegrip | |
Args: | |
background (str): The color used for the background. |