Skip to content

Commit 1b04262

Browse files
committed
complete 0000~0001
1 parent 2e026b4 commit 1b04262

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

LXFY/0000/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from PIL import Image, ImageDraw, ImageFont
2+
3+
def add_num(filePath, num=1):
4+
img = Image.open(filePath)
5+
size = img.size
6+
fontsize = size[1]/4
7+
myfont = ImageFont.truetype('Futura.ttf', fontsize)
8+
ImageDraw.Draw(img).text((2 * fontsize, 0), str(num), font = myfont, fill = 'red')
9+
img.save('avatar_added.jpg')
10+
img.show()

LXFY/0001/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import random, string
2+
3+
f = open('Promo_code.txt', 'wb')
4+
for i in range(200):
5+
chars = string.letters + string.digits
6+
s = [random.choice(chars) for i in range(10)]
7+
f.write(''.join(s) + '\n')
8+
f.close()

0 commit comments

Comments
 (0)