Skip to content

Instantly share code, notes, and snippets.

@brbsix
brbsix / pyqt5_scraper.py
Created June 16, 2016 13:07
PyQt5 Scraper
"""Render HTML for scraping"""
# -*- coding: utf-8 -*-
import os
import sys
from contextlib import contextmanager
from multiprocessing import Pool
try:
TimeoutError
@vdcrim
vdcrim / ddc-ci.py
Created February 11, 2015 00:35
Python script for adjusting the settings of my monitor, by using DDC/CI
#!/usr/bin/env python3
"""
Show and adjust display parameters on an Iiyama ProLite XB2483HSU-B1 monitor
Requirements:
- mentioned monitor (27' should also work) with DDC/CI setting on
- Windows Vista+
- Python 3
@pwuertz
pwuertz / PyQt5_OpenGl_TextureFromNumpy.py
Created October 27, 2014 09:44
PyQt5 Example: Create OpenGL texture from numpy array via mapped pixel buffer
from OpenGL import GL
from PyQt5 import QtWidgets, QtCore, QtGui, QtOpenGL
from OpenGL.GL.ARB.texture_rg import GL_R32F
import numpy as np
import ctypes
import time
w, h = 400, 400
class TestWidget(QtOpenGL.QGLWidget):
@tdhsmith
tdhsmith / gifiterate.py
Last active June 4, 2018 18:50 — forked from BigglesZX/gifextract.py
Generator to iterate over frames in an animated GIF, correctly handling palettes and frame update modes
import os
from PIL import Image
'''
I searched high and low for solutions to the "extract animated GIF frames in Python"
problem, and after much trial and error came up with the following solution based
on several partial examples around the web (mostly Stack Overflow).
There are two pitfalls that aren't often mentioned when dealing with animated GIFs -
firstly that some files feature per-frame local palettes while some have one global
@boppreh
boppreh / balloontip.py
Created November 2, 2012 11:35 — forked from wontoncc/balloontip.py
Balloon tip module, Python, using win32gui. Display a notification in the tray bar and quits after 10 seconds.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip:
@loisaidasam
loisaidasam / rename_images.py
Created August 7, 2012 22:06
Rename images for use by ImageMagick convert or ffmpeg convert
# Goes a little something like this:
import os
files = [ f for f in os.listdir('.') if os.path.isfile(os.path.join('.',f)) and f.endswith('.jpg') ]
for i, file in enumerate(sorted(files)):
os.rename(file, 'image%03d.jpg' % i)
# Now with them renamed you can do something like:
@wontoncc
wontoncc / balloontip.py
Last active July 6, 2024 19:59
Balloon tip module, Python, using win32gui.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip: