Python Challenge 9
来源:互联网 发布:台湾中央研究院 知乎 编辑:程序博客网 时间:2024/06/06 00:24
Level 9
标题是connect the dots。源代码里给了first 和 second一堆数,问first + second = ?
试了一下把first和second对应的图像灰度值加起来,用chr()转成字符,真的是’?’。修改url,结果不对。还是按照标题来,把这些点连起来。
中途遇到show()无法打开图片的问题,解决方法是把bmp的默认打开方式改成别的(只要不是windows viewer)
查到画图方法在PIL的ImageDraw。
from PIL import Image,ImageDrawfirst = [146,399,163,403,170,...] #此处略second = [156,141,165,135,169,...]im = Image.open('good.jpg')drawSurface = ImageDraw.Draw(im)drawSurface.line(first, fill=128)drawSurface.line(second, fill=128)im.show()
是一头牛。
0 0
- python challenge 7-9
- 【Python Challenge-9】good
- python challenge(9-18)
- Python Challenge 9
- Python Challenge 0-9
- python challenge
- Python Challenge
- Python Challenge
- python challenge
- Python Challenge
- Python challenge
- python challenge
- Python Challenge
- Lua Challenge -- From Python Challenge
- The Python Challenge Level 9-10 Solutions
- Python Challenge 谜题0
- Python Challenge 谜题1
- Python Challenge 谜题2
- 最大间隔
- 北化oj 2102 - 程序改错 - 二维数组参数传递
- mysql 5 插入数据有不识别字符问题 解决方法
- 基于原型的对象创建和继承
- 回溯算法之素数环问题
- Python Challenge 9
- android之socket编程实例(二)
- Java面向对象05-抽象方法,抽象类和接口
- 解析json格式的数据
- 数据结构4——Java 二叉树 遍历
- leetcode:144. Binary Tree Preorder Traversal
- 从Xcode项目中移除Reveal
- Java实现Mongo嵌套查询
- Java内存之本地内存分析神器: NMT 和 pmap