Archived
feat: upload
This commit is contained in:
32 files changed
+365
No files matched your search
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# -- coding:utf-8 --
|
||||
# @Author: markushammered@gmail.com
|
||||
# @Development Tool: PyCharm
|
||||
# @Create Time: 2022/2/3
|
||||
# @File Name: __init__.py.py
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
# -- coding:utf-8 --
|
||||
# @Author: markushammered@gmail.com
|
||||
# @Development Tool: PyCharm
|
||||
# @Create Time: 2022/2/3
|
||||
# @File Name: base2img.py
|
||||
|
||||
import base64
|
||||
|
||||
|
||||
def convert() -> None:
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
# image转base64
|
||||
lst = []
|
||||
for i in range(10):
|
||||
with open(f'../../static/number/{i}.png', 'rb') as f:
|
||||
base64_data = base64.b64encode(f.read())
|
||||
base64_code = 'data:image/jpeg;base64,' + base64_data.decode('utf-8')
|
||||
lst.append(base64_code)
|
||||
|
||||
print(lst)
|
||||
|
||||
for i in lst:
|
||||
print(i)
|
||||
|
||||
|
||||
convert()
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
# -- coding:utf-8 --
|
||||
# @Author: markushammered@gmail.com
|
||||
# @Development Tool: PyCharm
|
||||
# @Create Time: 2022/2/3
|
||||
# @File Name: numberlen.py
|
||||
|
||||
|
||||
number = 1576451745
|
||||
|
||||
if len(str(number)) <= 10:
|
||||
zero_count = 10 - len(str(number))
|
||||
final_str = '0' * zero_count + str(number)
|
||||
print(final_str[9])
|
||||
else:
|
||||
print('Too much to count')
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
# -- coding:utf-8 --
|
||||
# @Author: markushammered@gmail.com
|
||||
# @Development Tool: PyCharm
|
||||
# @Create Time: 2022/2/3
|
||||
# @File Name: resp_test.py
|
||||
|
||||
import requests
|
||||
import random
|
||||
|
||||
name_str = random.sample(range(1, 100), 30)
|
||||
for i in name_str:
|
||||
resp = requests.get(f'http://127.0.0.1:8000/API?owner={i}')
|
||||
print(resp.content)
|
||||
Reference in New Issue
Block a user