Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added llluiop/0010/DejaVuSansMono-Bold.ttf
Binary file not shown.
Binary file added llluiop/0010/DejaVuSansMono-BoldOblique.ttf
Binary file not shown.
Binary file added llluiop/0010/DejaVuSansMono-Oblique.ttf
Binary file not shown.
Binary file added llluiop/0010/DejaVuSansMono.ttf
Binary file not shown.
38 changes: 38 additions & 0 deletions llluiop/0010/RandomLetter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin.env python



from random import choice
import string
import Image
import ImageDraw
import ImageFont
import ImageFilter

def generateRandomLetters():
return ''.join([choice(string.ascii_uppercase) for x in range(4)])


def createVerifyImg(str):
img = Image.new('RGB', (240,60), (255,255,255))
font = ImageFont.truetype('DejaVuSansMono.ttf', 36)
draw = ImageDraw.Draw(img)

for x in range(240):
for y in range(60):
draw.point((x,y), tuple([choice(range(128,255)) for color in range(3)]))



for x in range(len(str)):
draw.text((60 * x + 10, 10), str[x], tuple([choice(range(32,127)) for color in range(3)]), font)

img = img.filter(ImageFilter.BLUR)
return img



if __name__ == "__main__":
img = createVerifyImg(generateRandomLetters())
img.show()
img.save("verifyImg.jpg")
Binary file added llluiop/0010/verifyImg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions llluiop/0011/filtered_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
����
����Ա
����Ա
�쵼
ţ��
ţ��
����
����
love
sex
jiangge
27 changes: 27 additions & 0 deletions llluiop/0011/filterwords.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python

import os



def Words(path):
filterwords = []
f = open(path)
for word in f.readlines():
filterwords.append(word.strip('\n'))

return filterwords


if __name__ == '__main__':
filteredwords = Words('filtered_words.txt')

while(True):
input = raw_input("input your line:").split()

if set(input).intersection(filteredwords):
print 'Freedom'
else:
print 'Human Rights'


11 changes: 11 additions & 0 deletions llluiop/0012/filtered_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
����
����Ա
����Ա
�쵼
ţ��
ţ��
����
����
love
sex
jiangge
26 changes: 26 additions & 0 deletions llluiop/0012/replacefilterwords.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python

import os



def Words(path):
filterwords = []
f = open(path)
for word in f.readlines():
filterwords.append(word.strip('\n'))

return filterwords


if __name__ == '__main__':
filteredwords = Words('filtered_words.txt')

while(True):
input = raw_input("input your line:")

for word in filteredwords:
if word in input:
input = input.replace(word, ''.join(['*' for x in range(len(word))]))

print input