Skip to content

Instantly share code, notes, and snippets.

View ethanhs's full-sized avatar
🐍
▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀ꜚ

Ethan Smith ethanhs

🐍
▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀ꜚ
View GitHub Profile
@ethanhs
ethanhs / PyExplorer.pyw
Created March 12, 2015 23:25
Windows only GPL licensed example of a taskbar with a start button (see http://www.deviantart.com/art/Windows-8-Metro-Orbs-320240575 for button) NOTE:not currently working part of https://github.com/IronManMark20/PyExplorer
import sys
import ctypes
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PIL import Image
from PIL.ImageQt import ImageQt
import pyautogui as pg
import platform
class Main(QWidget):
@ethanhs
ethanhs / PurepyHook.py
Last active December 13, 2023 02:02
This is a pure python (or as close as possible) keyboard hook module.
# Some of this adapted from BoppreH's answer here:http://stackoverflow.com/questions/9817531/applying-low-level-keyboard-hooks-with-python-and-setwindowshookexa
import ctypes
from ctypes import wintypes
from collections import namedtuple
KeyEvents=namedtuple("KeyEvents",(['event_type', 'key_code',
'scan_code', 'alt_pressed',
'time']))
handlers=[]
@ethanhs
ethanhs / getico.py
Created May 28, 2015 23:58
Get Icon for file (not working).
def geticon(PATH):
shfileinfostruct=SHFILEINFO()
SHGFI_ICON = 0x000000100
SHGFI_DISPLAYNAME = 0x000000200
SHGFI_TYPENAME = 0x000000400
SHGFI_ATTRIBUTES = 0x000000800
SHGFI_ICONLOCATION = 0x000001000
SHGFI_EXETYPE = 0x000002000
SHGFI_SYSICONINDEX = 0x000004000
SHGFI_LINKOVERLAY = 0x000008000
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <commoncontrols.h>
#include <CommCtrl.h>
#include <shellapi.h>
HICON JumboIcon(LPTSTR pszPath)
{
import ctypes
from ctypes import wintypes
#imports
GetWindowLong=ctypes.windll.user32.GetWindowLongW
SetWindowLong=ctypes.windll.user32.SetWindowLongW
SetLayeredWindowAttributes=ctypes.windll.user32.SetLayeredWindowAttributes
GetShell=ctypes.windll.user32.GetShellWindow
EnumChildren = ctypes.windll.user32.EnumChildWindows
EnumWindows=ctypes.windll.user32.EnumWindows
/* Melody
* (cleft) 2005 D. Cuartielles for K3
*
* This example uses a piezo speaker to play melodies. It sends
* a square wave of the appropriate frequency to the piezo, generating
* the corresponding tone.
*
* The calculation of the tones is made following the mathematical
* operation:
*
<?xml version="1.0" encoding="utf-8"?>
<Language>
<lang_name>fr</lang_name>
<title_error>Erreur</title_error>
<title_info>Information</title_info>
<title_warning>Avertissement</title_warning>
<title_finished>Fini</title_finished>
<title_eula>CLUF</title_eula>
<title_bg_disabled>Background désactivée</title_bg_disabled>
<title_are_you_sure>Est-ce que vous êtes sûr</title_are_you_sure>
@ethanhs
ethanhs / mjpegserver.py
Last active August 29, 2015 14:27 — forked from tito/mjpegserver.py
MJPEG Server module demo for Kivy
'''
Stream the Kivy window into a MJPEG HTTP server
===============================================
:Configuration:
`ip` : str, default to ''
By default, server will listen on all ips availables
`port` : int, default to 8000
TCP Port to listen
`fps` : int, default to 20
qchildevent_wrapper
qcoreapplication_wrapper
qcryptographichash_wrapper
qdate_wrapper
qdatetime_wrapper
qdir_wrapper
qdiriterator_wrapper
qdynamicpropertychangeevent_wrapper
qeasingcurve_wrapper
qelapsedtimer_wrapper
Initializing submodules for PySide version 2.0.0.dev0
Checking out submodule shiboken2 to branch qt5
Checking out submodule pyside2 to branch qt5
Checking out submodule pyside-tools2 to branch qt5
Checking out submodule pyside-examples2 to branch qt5
Removing C:\pyside-setup2\pyside_package
running install
running bdist_egg
running build
Python architecture is 32bit