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
import math | |
from PIL import Image | |
def spiral(r=20): | |
im = Image.new("RGB", (r * 2, r * 2), (255, 255, 255)) | |
inc = 10 | |
inside = True | |
angle = 0 |
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 PIL import Image | |
from python.common import line as ln | |
def polygon(points): | |
# first lets convert the points to lines | |
lines = [] | |
xmax = 0 | |
ymax = 0 |
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
#-*- coding: utf-8 -*- | |
def bitsort(inlist): | |
tmplist = list([0] * 100) | |
for item in inlist: | |
tmplist[item] = 1 | |
outlist = [i for i, item in enumerate(tmplist) if item == 1] | |
return outlist |