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/python3 | |
| # vim:fileencoding=utf-8:sw=4:et | |
| # Convert between pygobject Pixbuf and PIL/Pillow image format | |
| # Also a function to do fast gamma correction with Pillow image | |
| from __future__ import print_function, unicode_literals, absolute_import | |
| import sys | |
| from gi.repository import GLib, GdkPixbuf |
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 pydub import AudioSegment | |
| from matplotlib import pyplot as plot | |
| from PIL import Image, ImageDraw | |
| import numpy as np | |
| import os | |
| src = "./test.mp3" | |
| audio = AudioSegment.from_file(src) | |
| data = np.fromstring(audio._data, np.int16) |
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
| # Requires pydub (with ffmpeg) and Pillow | |
| # | |
| # Usage: python waveform.py <audio_file> | |
| import sys | |
| from pydub import AudioSegment | |
| from PIL import Image, ImageDraw | |
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 | |
| # Based on code by Stephan Sokolow | |
| # MIT-licensed | |
| # Source: https://gist.github.com/ssokolow/e7c9aae63fb7973e4d64cff969a78ae8 | |
| """python-xlib example which reacts to changing the active window/title. | |
| Requires: | |
| - Python | |
| - python-xlib |
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
| # | |
| # Get web page screenshot | |
| # | |
| # usage: | |
| # xvfb-run -s "-screen 0 1024x768x24" python getschreenshot.py test.html | |
| # | |
| # libs: | |
| # - pygtk: http://www.pygtk.org/ | |
| # - pywebkitgtk(python-webkit): http://code.google.com/p/pywebkitgtk/ | |
| # - PIL: http://www.pythonware.com/products/pil/ |
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 | |
| # -*- coding: utf-8 -*- | |
| #https://developer.gnome.org/pygobject/2.28/ | |
| #http://www.pygtk.org/articles/subclassing-gobject/sub-classing-gobject-in-python.htm#d0e570 | |
| from gi.repository import GObject | |
| from gi.repository import GLib | |
| class GAsyncSpawn(GObject.GObject): |
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
| <touchégg> | |
| <settings> | |
| <property name="animation_delay">150</property> | |
| <property name="action_execute_threshold">20</property> | |
| <property name="color">909090</property> | |
| <property name="borderColor">FFFFFF</property> | |
| </settings> | |
| <application name="All"> |