Skip to content

Instantly share code, notes, and snippets.

View aoout's full-sized avatar
🍉
Working from home

aoout aoout

🍉
Working from home
View GitHub Profile
@aoout
aoout / README.md
Last active August 7, 2021 01:30
通过python自行搭建本地弹弹play自动下载服务。

初始化设置

前提是有个能用的はしご,若没有,也可以参考 官方api文档自行添加可以直连的的资源。

下载下面的两个文件,在根目录下运行:

pip install -r requirents.txt
@aoout
aoout / newfile.py
Created August 22, 2021 07:07
通过a模式完成"读取一个文件时,若其不存在,则先将其创建"的需求。
with open(file_path,"a+"):
seek(0)
# 后续操作
@aoout
aoout / email.py
Created August 22, 2021 11:05
简单封装了一下电子邮件的发送。
from smtplib import SMTP_SSL
from email.mime.text import MIMEText
class Receiver:
def __init__(self, email: str) -> None:
self.email = email
class Message:
import sys
from PyQt5.QtWidgets import (QApplication, QFrame, QHBoxLayout, QMainWindow,
QPushButton, QStackedWidget, QTextBrowser,
QVBoxLayout, QWidget)
class NavigationBar(QFrame):
def __init__(self):
super().__init__()
import sys
from PyQt5.QtCore import QPropertyAnimation, QPoint, QSequentialAnimationGroup
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
class MainWindow(QWidget):
def __init__(self):
super().__init__()
self.resize(400, 300)
self.setStyleSheet("background-color: #F5F5F5;")
from qframelesswindow import FramelessWindow, StandardTitleBar
from PyQt5.QtWidgets import QApplication
class Window(FramelessWindow):
def __init__(self):
super().__init__()
self.setTitleBar(StandardTitleBar(self))
self.setWindowTitle("...")
self.resizeWindow()
self.initLayout()
import matplotlib.pyplot as plt
def draw_chessboard(n):
chessboard = [[0] * n for _ in range(n)]
fig, ax = plt.subplots(figsize=(n, n))
ax.set_aspect('equal')
ax.axis('off')
for i in range(n):
@aoout
aoout / Desk.py
Created July 17, 2023 12:07
这个程序从我的obsidian db floder中获取数据,构建卡牌图片,用于tts内的custom desk。
import os
import textwrap
from collections import UserList
from itertools import chain
from pathlib import Path
from tempfile import TemporaryDirectory
import matplotlib.font_manager as fm
import matplotlib.pyplot as plt
from PIL import Image
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-var-requires */
import * as xml2js from "xml2js";
import * as path from "path";
import extract from "extract-zip";
import jetpack from "fs-jetpack";
import { Path, tFile } from "../utils/path";