QQ可以使用xml的方式发送消息,以下为了方便描述统称为卡片。
通过机器人的API进行发送xml即可,但是如果选择发送xml,那么其他如[image=xxx]
、[@xxx]
这些命令就不可使用了。整个消息只有XML。
xml主要由msg
,item
,source
这3部分组成
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
# -*- coding: utf-8 -*- | |
import os | |
os.environ["UNRAR_LIB_PATH"] = r"C:\Program Files (x86)\UnrarDLL\x64\UnRAR64.dll" | |
import shutil | |
from unrar import rarfile | |
from pprint import pprint | |
# -*- coding: utf-8 -*- | |
import ctypes | |
from collections import namedtuple | |
from ctypes import wintypes | |
# import win32process | |
class MODULEENTRY32W(ctypes.Structure): | |
_fields_ = [ | |
("dwSize", wintypes.DWORD), |
async def app2(scope, receive, send): | |
if scope["type"] == "http": | |
# request = Request(scope, receive) | |
# body = await request.body() | |
# print(body) | |
await send( | |
{ | |
"type": "http.response.start", | |
"status": 200, | |
"headers": [ |
def safe_eval(c): | |
allow_func = {"print": print, "input": input} | |
bytecode = compile(c, "", "eval") | |
for name in bytecode.co_names: | |
if name not in allow_func: | |
raise Exception(f"not allowed function: {name}") | |
return eval(bytecode, {"__builtins__": {}}, allow_func) |
import sys | |
import hashlib | |
md = hashlib.md5() | |
with open(sys.argv[1], "rb") as f: | |
while chunk := f.read(60 * 1024): | |
md.update(chunk) | |
print(md.hexdigest()) |
#ifndef _UNISTD_H | |
#define _UNISTD_H | |
#include <io.h> | |
#include <process.h> | |
#endif |
""" | |
Copyright (c) 2008-2022 synodriver <[email protected]> | |
""" | |
import asyncio | |
from pathlib import Path | |
from watchfiles import Change, awatch | |
async def main(): |
function main(splash, args) | |
assert(splash:go(args.url, nil, { | |
["Cookie"] = args.cookie | |
})) | |
assert(splash:wait(1)) | |
local element = splash:select("#accessCode") | |
local ok, reason = element:send_text("glib") -- 输入提取码 | |
if not ok then | |
return reason |
""" | |
Copyright (c) 2008-2021 synodriver <[email protected]> | |
""" | |
import numpy as np | |
YIELD_STRESS = 400 # 屈服强度400Mpa | |
def main(): | |
data = np.loadtxt("data.csv", delimiter=",") # 读取应力应变曲线 第一列应力 第二列应变 |