示例#1
0
def resolve():
    with open('oxygen.png','w') as img:
        img.write(get_external_resource('http://www.pythonchallenge.com/pc/def/oxygen.png'))
    img = Image.open("oxygen.png")
    w,h = img.size
    info = ''.join([chr(img.getpixel((i,h//2))[0]) for i in range(0,w,7)])
    return ''.join(map(chr,map(int,pattern.findall(info)[0].split(','))))
示例#2
0
def resolve():
    with open('good.jpg','w') as img:
        img.write(get_external_resource('http://www.pythonchallenge.com/pc/return/good.jpg'))
    img = Image.open("good.jpg")
    blankImg = Image.new(img.mode, img.size)
    color = (100,255,100)
    points = [(first[x],first[x+1]) for x in range(0,len(first),2)]
    points.extend([(second[x],second[x+1]) for x in range(0,len(second),2)])
    blankImg.putpixel2 = partial(blankImg.putpixel,value=color)

    for point in points:
        blankImg.putpixel2(point)

    blankImg.save("c9answer.jpg")
示例#3
0
def resolve():
    with open('channel.zip','w') as channelZip:
        channelZip.write(get_external_resource('http://www.pythonchallenge.com/pc/def/channel.zip'))
    with ZipFile('channel.zip','r') as channel:
        return find_next(channel)
示例#4
0
def resolve():
    banner_p = get_external_resource('http://www.pythonchallenge.com/pc/def/banner.p')
    obj = pickle.loads(banner_p)
    for item in obj:
        print "".join(map(lambda p: p[0]*p[1], item))
    return 'channel'