<NME> 0010.py
<BEF> 

<MSG> commit 0010.py

<DFF> @@ -1,1 +1,35 @@
 
+from PIL import Image, ImageDraw, ImageFont, ImageFilter
+import random
+verificationCode = ['K', 'L', 'K', 'B']
+
+
+def rndColor():
+    return (random.randint(64, 255), random.randint(64, 255),
+            random.randint(64, 255))
+
+
+def rndColor2():
+    return (random.randint(32, 127), random.randint(32, 127),
+            random.randint(32, 127))
+
+
+width = 60 * 4
+height = 60
+image = Image.new('RGB', (width, height), (255, 255, 255))
+font = ImageFont.truetype('Arial.ttf', 36)
+draw = ImageDraw.Draw(image)
+
+# 背景
+for x in range(width):
+    for y in range(height):
+        draw.point((x, y), fill=rndColor())
+
+# 文字
+for k in range(4):
+    draw.text((60 * k + 10, 10), verificationCode[k], font=font, fill=rndColor2())
+
+# 模糊
+
+image = image.filter(ImageFilter.BLUR)
+image.save('code.jpg', 'jpeg')

{'commit': "diff --git a/mio4kon/0010/0010.py b/mio4kon/0010/0010.py\nindex 8b13789..6e6904d 100644\n--- a/mio4kon/0010/0010.py\n+++ b/mio4kon/0010/0010.py\n@@ -1 +1,35 @@\n \n+from PIL import Image, ImageDraw, ImageFont, ImageFilter\n+import random\n+verificationCode = ['K', 'L', 'K', 'B']\n+\n+\n+def rndColor():\n+    return (random.randint(64, 255), random.randint(64, 255),\n+            random.randint(64, 255))\n+\n+\n+def rndColor2():\n+    return (random.randint(32, 127), random.randint(32, 127),\n+            random.randint(32, 127))\n+\n+\n+width = 60 * 4\n+height = 60\n+image = Image.new('RGB', (width, height), (255, 255, 255))\n+font = ImageFont.truetype('Arial.ttf', 36)\n+draw = ImageDraw.Draw(image)\n+\n+# 背景\n+for x in range(width):\n+    for y in range(height):\n+        draw.point((x, y), fill=rndColor())\n+\n+# 文字\n+for k in range(4):\n+    draw.text((60 * k + 10, 10), verificationCode[k], font=font, fill=rndColor2())\n+\n+# 模糊\n+\n+image = image.filter(ImageFilter.BLUR)\n+image.save('code.jpg', 'jpeg')\ndiff --git a/mio4kon/0010/code.jpg b/mio4kon/0010/code.jpg\nnew file mode 100644\nindex 0000000..16108a8\nBinary files /dev/null and b/mio4kon/0010/code.jpg differ\n", 'commit_subject': 'commit 0010.py', 'repo_name': 'Show-Me-the-Code/python', 'committer': {'name': 'mio4kon', 'email': '8a84ab496a311ec0a306e135b5c77138daa273e4@sina.com', 'time_sec': '1477463154', 'tz_offset': '480', 'date': {'seconds': '1477463154'}}, 'commit_tree': '9ecffed37565409c32957985c8586ac03fed48e5', 'commit_message': 'commit 0010.py\n', 'language_name': 'HTML', 'license': 'mit', 'hunks': "@@ -1,1 +1,35 @@\n \n+from PIL import Image, ImageDraw, ImageFont, ImageFilter\n+import random\n+verificationCode = ['K', 'L', 'K', 'B']\n+\n+\n+def rndColor():\n+    return (random.randint(64, 255), random.randint(64, 255),\n+            random.randint(64, 255))\n+\n+\n+def rndColor2():\n+    return (random.randint(32, 127), random.randint(32, 127),\n+            random.randint(32, 127))\n+\n+\n+width = 60 * 4\n+height = 60\n+image = Image.new('RGB', (width, height), (255, 255, 255))\n+font = ImageFont.truetype('Arial.ttf', 36)\n+draw = ImageDraw.Draw(image)\n+\n+# 背景\n+for x in range(width):\n+    for y in range(height):\n+        draw.point((x, y), fill=rndColor())\n+\n+# 文字\n+for k in range(4):\n+    draw.text((60 * k + 10, 10), verificationCode[k], font=font, fill=rndColor2())\n+\n+# 模糊\n+\n+image = image.filter(ImageFilter.BLUR)\n+image.save('code.jpg', 'jpeg')\n", 'addition_count': 34, 'deletion_count': 0, 'src_file': 'a/mio4kon/0010/0010.py', 'tgt_file': 'b/mio4kon/0010/0010.py', 'file_extension': '.py', 'before_file': '\n', 'message': 'commit 0010.py\n', 'author_name': 'mio4kon', 'lang': 'py'}