commit
63aedf01e1
|
@ -3,5 +3,8 @@ yfinance==0.1.54
|
||||||
python-dateutil~=2.8.1
|
python-dateutil~=2.8.1
|
||||||
setuptools~=54.0.0
|
setuptools~=54.0.0
|
||||||
ruamel.yaml
|
ruamel.yaml
|
||||||
qrcode
|
qrcode~=6.1
|
||||||
Pillow
|
Pillow
|
||||||
|
pyautogui
|
||||||
|
selenium
|
||||||
|
requests
|
|
@ -0,0 +1,46 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Python Random String Password
|
||||||
|
# Author - HoneyMoose(huyuchengus@gmail.com)
|
||||||
|
# Link Article - https://www.ossez.com/t/python-pyautogui/13400
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
import pyautogui
|
||||||
|
|
||||||
|
while True:
|
||||||
|
# 移动鼠标,duration=0.1是鼠标移动过程中的延迟速度
|
||||||
|
pyautogui.moveTo(x=300, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
# 移动鼠标到坐标后,单击左键
|
||||||
|
pyautogui.click(x=700, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
# 移动鼠标到坐标后,双击左键
|
||||||
|
pyautogui.doubleClick(x=600, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
# 移动鼠标到坐标后,单击右键
|
||||||
|
pyautogui.rightClick(x=700, y=300, duration=0.1)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
pyautogui.click(x=100, y=200)
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
|
pyautogui.click(x=200, y=400)
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
|
# 可以在 Windows 中打开 Paint,然后执行下面的语句
|
||||||
|
distance = 200
|
||||||
|
while distance > 0:
|
||||||
|
pyautogui.drag(distance, 0, duration=0.5) # move right
|
||||||
|
distance -= 5
|
||||||
|
pyautogui.drag(0, distance, duration=0.5) # move down
|
||||||
|
pyautogui.drag(-distance, 0, duration=0.5) # move left
|
||||||
|
distance -= 5
|
||||||
|
pyautogui.drag(0, -distance, duration=0.5) # move up
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
# Python Random String Password
|
# Python Random String Password
|
||||||
# Author - HoneyMoose(huyuchengus@gmail.com)
|
# Author - HoneyMoose(huyuchengus@gmail.com)
|
||||||
# Link Article - https://www.ossez.com/c/open-source/python/14
|
# Link Article - https://www.ossez.com/t/python/13398
|
||||||
|
|
||||||
import string
|
import string
|
||||||
from random import choice
|
import random
|
||||||
|
|
||||||
|
|
||||||
def random_password(length, printable):
|
def random_password(length, printable):
|
||||||
|
@ -15,14 +15,13 @@ def random_password(length, printable):
|
||||||
:param int length: 生成随机字符串的数量
|
:param int length: 生成随机字符串的数量
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return "".join([choice(printable) for x in range(int(length))])
|
return "".join([random.choice(printable) for x in range(int(length))])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
3
|
3
|
||||||
print(__name__)
|
print(__name__)
|
||||||
|
|
||||||
|
|
||||||
amount = int(input("请输入需要生成随机字符串的数量: "))
|
amount = int(input("请输入需要生成随机字符串的数量: "))
|
||||||
number = int(input("请输入随机字符串的长度: "))
|
number = int(input("请输入随机字符串的长度: "))
|
||||||
|
|
||||||
|
@ -32,3 +31,16 @@ for i in range(1, amount + 1):
|
||||||
print('')
|
print('')
|
||||||
for i in range(1, amount + 1):
|
for i in range(1, amount + 1):
|
||||||
print(f" 随机字符串 [Ascii Uppercase String]: {i} - {repr(random_password(number, string.ascii_uppercase))} ")
|
print(f" 随机字符串 [Ascii Uppercase String]: {i} - {repr(random_password(number, string.ascii_uppercase))} ")
|
||||||
|
|
||||||
|
print('')
|
||||||
|
for i in range(1, amount + 1):
|
||||||
|
print(f" 随机字符串 [Ascii Lowercase String]: {i} - {repr(random_password(number, string.ascii_lowercase))} ")
|
||||||
|
|
||||||
|
print('')
|
||||||
|
for i in range(1, amount + 1):
|
||||||
|
print(f" 随机字符串 [Ascii Digits String]: {i} - {repr(random_password(number, string.digits))} ")
|
||||||
|
|
||||||
|
# choices Function Test
|
||||||
|
print('')
|
||||||
|
my_list = ["apple", "banana", "cherry"]
|
||||||
|
print(random.choices(my_list, weights=[10, 1, 1], k=12))
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Python Email Sending Test
|
||||||
|
# Author - HoneyMoose(huyuchengus@gmail.com)
|
||||||
|
# Link Article - https://www.ossez.com/t/python-api/13402
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
# MAILGUN API SEND MESSAGE
|
||||||
|
def mailgun_api_send_message():
|
||||||
|
return requests.post(
|
||||||
|
"https://api.mailgun.net/v3/sandbox7955c7c533744fb28e650b72192eac87.mailgun.org",
|
||||||
|
auth=("api", "YOUR_API_KEY"),
|
||||||
|
data={"from": "OSSEZ <huyuchengus@gmail.com>",
|
||||||
|
"to": ["huyuchengus@gmail.com"],
|
||||||
|
"subject": "Hello MailGun API",
|
||||||
|
"text": "Testing Sending mail by Mailgun API!"})
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
for i in range(3):
|
||||||
|
print(mailgun_api_send_message().text)
|
Loading…
Reference in New Issue