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 to_base(integer, base_list=None): | |
""" | |
Convert an integer to an arbitrarily-represented arbitrary-base number | |
system. | |
The base representation must be defined in the `base list` parameter. | |
The base is taken from the length of the list. | |
:param integer: Base 10 int() | |
:type integer: int() |
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
from pygments.formatter import Formatter | |
import json | |
class Formatter(Formatter): | |
name = 'JSON' | |
aliases = ['json'] | |
filenames = [] | |
def format(self, tokensource, outfile): | |
arr = [] |
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
""" | |
Python IRC ASCII to image script by e ([email protected]) | |
""" | |
import Image, ImageFont, ImageDraw | |
import time, re | |
_strip_colors_regex = re.compile('(\x03([0-9]{1,2})(,[0-9]{1,2})?)|[\x0f\x02\x1f\x03\x16]').sub | |
def strip_colors(string): |