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 / 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:
*
@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
@ethanhs
ethanhs / en_US.xml
Created September 15, 2015 03:47
from Windows-10-Login-Background-Changer
<?xml version="1.0" encoding="utf-8"?>
<Language>
<!-- This must be in the language of the file to make it easier on people D: -->
<lang_name>English (US)</lang_name>
<!-- titles -->
<title_error>Error</title_error>
<title_info>Info</title_info>
<title_warning>Warning</title_warning>
<title_finished>Finished</title_finished>
@ethanhs
ethanhs / Search_Start.py
Created September 22, 2015 03:04
Needs IronPython!! As asked for. This gets the names, and rects of the tiles on your start screen. I also found that it grabs text of a start tile. Yay accessibility!
import ctypes
from ctypes import wintypes
#import pyscreenshot as ImageGrab
titles=[]
def GetHWND(self, hwnd, lParam):
if IsWindowVisible(hwnd):
length = GetWindowTextLength(hwnd)
buff = ctypes.create_unicode_buffer(length + 1)
GetWindowText(hwnd, buff, length + 1)
if buff.value != u'':