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
"""Render HTML for scraping""" | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
from contextlib import contextmanager | |
from multiprocessing import Pool | |
try: | |
TimeoutError |
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
#!/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 |
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
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): |
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 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 |
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
# -- coding: utf-8 -- | |
from win32api import * | |
from win32gui import * | |
import win32con | |
import sys, os | |
import struct | |
import time | |
class WindowsBalloonTip: |
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
# 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: |
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
# -- coding: utf-8 -- | |
from win32api import * | |
from win32gui import * | |
import win32con | |
import sys, os | |
import struct | |
import time | |
class WindowsBalloonTip: |