(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # -- coding: utf-8 -- | |
| from win32api import * | |
| from win32gui import * | |
| import win32con | |
| import sys, os | |
| import struct | |
| import time | |
| class WindowsBalloonTip: |
| # 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: |
| # -- coding: utf-8 -- | |
| from win32api import * | |
| from win32gui import * | |
| import win32con | |
| import sys, os | |
| import struct | |
| import time | |
| class WindowsBalloonTip: |
| 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 |
| 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): |
| """Render HTML for scraping""" | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import sys | |
| from contextlib import contextmanager | |
| from multiprocessing import Pool | |
| try: | |
| TimeoutError |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/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 |