Skip to content

Commit 4ae4dfa

Browse files
committed
0000
1 parent d781822 commit 4ae4dfa

4 files changed

Lines changed: 11 additions & 19 deletions

File tree

houshengandt/0000/0000.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
1-
import os
21
from PIL import Image, ImageDraw, ImageFont
3-
from random import randint
42

53

6-
# s = "3"
7-
# a = Image.open("1.jpg")
8-
# f = ImageFont.truetype("arial.ttf", 40)
9-
# b = ImageDraw.Draw(a)
10-
# b.text((90, 90), s, fill='red', font=f)
11-
# a.save("2.jpg")
12-
13-
14-
15-
16-
def add_num(filename='1.jpg', text='?', size=40, color='red', newname="2.jpg"):
4+
def add_num(filename, text='9', size=40, color='red'):
175
a = Image.open(filename)
186
print(a.size)
197
f = ImageFont.truetype("arial.ttf", size)
208
b = ImageDraw.Draw(a)
219
x, y = a.size
22-
xy = (x - 40, y - 170)
10+
xy = (x - 40, y - 190)
2311
b.text(xy, text, fill=color, font=f)
12+
newname = "new" + filename
2413
a.save(newname)
2514

15+
if __name__ == "__main__":
16+
test = add_num("1.jpg")
2617

27-
# add_num(text="3")
2818

29-
for root, dirs, files in os.walk("C:\\Users\\housh\\Desktop\\tx"):
30-
for file in files:
31-
print(type(file))
32-
add_num("C:\\Users\\housh\\Desktop\\tx\\" + file, newname='new' + file)

houshengandt/0000/1.jpg

3.14 KB
Loading

houshengandt/0000/new1.jpg

3.98 KB
Loading

houshengandt/0001/0001.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import uuid
2+
3+
4+
for i in range(200):
5+
keys = str(uuid.uuid4())
6+
print(keys)

0 commit comments

Comments
 (0)