This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import os | |
| def remove_any_dir_file(dir_or_file_path: str) -> None: | |
| """ 删除任意文件/文件夹。非空文件夹依然可以正确删除。 | |
| 例如: | |
| >>> import os | |
| >>> dir_path = os.path.join(os.getcwd(), 'test') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| File Name : send_mail.py | |
| Create Date : 2020/10/24 15:26 | |
| """ | |
| import threading | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| class SendMail: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from playwright.sync_api import sync_playwright | |
| def save_mhtml(path: str, text: str): | |
| with open(path, mode='w', encoding='UTF-8', newline='\n') as file: | |
| file.write(text) | |
| def save_page(url: str, path: str): | |
| with sync_playwright() as playwright: | |
| browser = playwright.chromium.launch(headless=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz |