Skip to content

Instantly share code, notes, and snippets.

View driscollis's full-sized avatar

Mike Driscoll driscollis

View GitHub Profile
import wx
class MainFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title='')
panel = wx.Panel(self)
self.statusbar = self.CreateStatusBar(
1, style=wx.STB_SIZEGRIP|wx.STB_ELLIPSIZE_END|wx.FULL_REPAINT_ON_RESIZE)
@driscollis
driscollis / watermark_transparent.py
Last active January 12, 2021 02:26
PySimpleGUI watermarking utility
# watermark_transparent.py
from PIL import Image
def watermark_with_transparency(input_image_path, output_image_path,
watermark_image_path, position):
base_image = Image.open(input_image_path)
watermark = Image.open(watermark_image_path)
width, height = base_image.size
import pathlib
import PySimpleGUI as sg
from PIL import Image, ImageTk
supported_image_types = [".png", ".jpg", "jpeg", ".tiff", ".bmp"]
elements = [
[sg.Image(key="-IMAGE-")],
[
sg.Text("Image Folder"),
import wx
class ImagePanel(wx.Panel):
def __init__(self, parent, image_size):
super().__init__(parent)
self.max_size = 240
self.file_path = None
img = wx.Image(*image_size)
177 INFO: PyInstaller: 3.6
178 INFO: Python: 3.8.2
179 INFO: Platform: Windows-10-10.0.10586-SP0
186 INFO: wrote C:\Users\mike\OneDrive\Documents\image_viewer_psg.spec
192 INFO: UPX is not available.
221 INFO: Extending PYTHONPATH with paths
['C:\\Users\\mike\\OneDrive\\Documents', 'C:\\Users\\mike\\OneDrive\\Documents']
225 INFO: checking Analysis
229 INFO: Building Analysis because Analysis-00.toc is non existent
231 INFO: Initializing module dependency graph...
import PySimpleGUI as sg
import os.path
# --------------------------------- Define Layout ---------------------------------
# First the window layout...2 columns
left_col = [
[
sg.Text("Folder"),
@driscollis
driscollis / combo_changer.py
Created January 3, 2020 16:37
Changing a wx.CombBox contents dynamically
import wx
class MainPanel(wx.Panel):
def __init__(self, parent):
super().__init__(parent)
self.cb_value = 'One'
self.combo_contents = ['One', 'Two', 'Three']
@driscollis
driscollis / mvp_kivy_example.py
Created June 4, 2019 14:16
Kivy layout example
import kivy
import random
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
red = [1,0,0,1]
green = [0,1,0,1]
blue = [0,0,1,1]
import wx
from ObjectListView import ObjectListView, ColumnDefn
import time
class TimeObj:
def __init__(self, start, end):
self.start = time.strftime('%H:%M:%S',
time.gmtime(start))
self.end = time.strftime('%H:%M:%S',
import wx
class MyTree(wx.TreeCtrl):
def __init__(self, parent, id, pos, size, style):
wx.TreeCtrl.__init__(self, parent, id, pos, size, style)
class TreePanel(wx.Panel):
def __init__(self, parent):