This file contains 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 python | |
"""Sample script which uses event.py (improved). """ | |
import event | |
class Publisher(object): | |
# Set event object in class declaration. |
This file contains 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 python | |
import binascii | |
import socket | |
PORT_DEFAULT = 9 | |
IPADDR_DEFAULT = '<broadcast>' | |
_USAGE = """Usage: | |
python wol.py [options] <MAC address>... |
This file contains 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 python | |
# | |
# Create hard links / junctions to the system-installed packages in | |
# a given virtualenv ("site-packages") directory. | |
# | |
# | |
# Background | |
# ========== | |
# | |
# Some libraries such as wxPython do not support pip installation yet. |
This file contains 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
@echo off | |
setlocal enabledelayedexpansion | |
set TemplateDir=new-templates | |
REM # If no args are given, show help (and exit). | |
if "%1"=="" goto HELP | |
REM # Options | |
if /i "%1" == "/?" goto HELP |
This file contains 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 python | |
from __future__ import (absolute_import, | |
division, | |
print_function, | |
unicode_literals) | |
import math | |
import time | |
import wx |
This file contains 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
def iterlines_backword(s): | |
""" Iterate lines of `s` from its tail to its top. | |
>>> list(iterlines_backword('a')) | |
['a'] | |
>>> list(iterlines_backword('a\\n')) | |
['a\\n'] | |
>>> list(iterlines_backword('a\\nb')) | |
['b', 'a\\n'] |
This file contains 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
# This file must be used with "source bin/activate.csh" *from csh*. | |
# You cannot run it directly. | |
# Created by Davide Di Blasi <davidedb@gmail.com>. | |
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; test $?_OLD_PYTHONHOME != 0 && setenv PYTHONHOME "$_OLD_PYTHONHOME" && unset _OLD_PYTHONHOME;unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' | |
# Unset irrelevant variables. | |
deactivate nondestructive | |
setenv VIRTUAL_ENV "/path/to/your/venv" |
This file contains 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
# Makefile to build FreeType 2 DLLs / static libs for MS Windows. | |
VER_NAME = freetype-2.5.5 | |
GIT_TAG = VER-2-5-5 | |
PLATFORMTOOLSET = v$(VISUALSTUDIOVERSION:.=) | |
SRC_DIR = freetype2 | |
CD_SRC_DIR = cd $(SRC_DIR) | |
DIST_BASE = $(VER_NAME)-win32-$(PLATFORMTOOLSET) |
This file contains 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
# Makefile to build wxWidgets for MS Windows. | |
!IFDEF WX | |
INSTALL_DIR = $(WX) | |
!ELSE IFNDEF INSTALL_DIR | |
INSTALL_DIR = C:\wxWidgets | |
!ENDIF | |
!IFNDEF SRC_DIR | |
SRC_DIR = wxWidgets |
This file contains 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
# event.py (simple) | |
class Event(object): | |
def __init__(self): | |
self.handlers = [] | |
def add(self, handler): | |
self.handlers.append(handler) | |
return self |
OlderNewer