
Lv.1
只是喜欢Python而已……徒弟:程序侯
签名:只是喜欢Python而已…… 徒弟:程序侯
在 招Python徒弟啦! 中回复
creeper? awww man so we back in the mine got our pick axe swinging from s2s,ss2s
2020-05-31T08:48:12 点赞:0
在 论坛管喵,来封我号啊 中回复
import requests
from json import dumps, loads
from bs4 import BeautifulSoup
class codemaoAPI(object):
def __init__(self, identity, password,
UA='Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KH喵L, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
debug=False):
self.debug = debug
self.ses = requests.session()
self.headers = {"Content-Type": "application/json", "User-Agent": UA}
self.log('getting pid...')
soup = BeautifulSoup(requests.get('https://shequ.codemao.cn', headers = self.headers).text, 'html.parser')
pid = loads(soup.find_all("script")[0].string.split("=")[1])['pid']
self.log('Successfully get pid;pid=' + pid)
self.log('loginning...')
a = self.ses.post('https://api.codemao.cn/tiger/v3/web/accounts/login', headers = self.headers,
data = dumps({"identity": identity, "password": password, "pid": pid}))
if a.status_code == 200:
self.log("Successfully login to codemao.cn")
else:
self.log('End of login to codemao.cn;response', a.status_code)
def log(self, *msg):
if self.debug:
print(*msg)
def send_post(self, board, title, message):
self.log('posting...')
a = self.ses.post(f'https://api.codemao.cn/web/forums/boards/{board}/posts', headers = self.headers,
data = dumps({'title': title, 'content': message}))
self.log('End.response', a.status_code)
def replies(self, postID, message):
self.log('replieing...')
a = self.ses.post(f'https://api.codemao.cn/web/forums/posts/{postID}/replies', headers = self.headers,
data = dumps({'content': message}))
self.log('End.response', a.status_code)
def __delete_work(self, workID): # BUG
self.log('deleting...')
a = self.ses.delete(f'https://api.codemao.cn/tiger/work/{workID}/temporarily', headers = self.headers)
self.log('End.response', a.status_code)
def __recove_work(self, workID): # BUG
self.log('recoving...')
a = self.ses.patch(f'https://api.codemao.cn/tiger/work/{workID}/recover', headers = self.headers)
self.log('End.response', a.status_code)
def __permanent_work(self, workID): # BUG
self.log('permanenting...')
a = self.ses.delete(f'https://api.codemao.cn/tiger/work/{workID}/permanently', headers = self.headers)
self.log('End.response', a.status_code)
def delete_all_work(self):
self.log('All work are permanenting...')
a = self.ses.delete('https://api.codemao.cn/tiger/work/user/works/permanently', headers = self.headers)
self.log('End.response', a.status_code)
def send_post_to_work_shop(self, work_shop_ID, message):
self.log('posting...')
a = self.ses.post(f'https://api.codemao.cn/web/discussions/{work_shop_ID}/comment', headers = self.headers,
data = dumps({"content": message, "rich_content": message, "source": "WORK_SHOP"}))
self.log('End.response', a.status_code)
def top_replies(self, repliesID):
self.log('On top...')
a = self.ses.put(f'https://api.codemao.cn/web/forums/replies/{repliesID}/top', headers = self.headers,
data = r'{}')
self.log('End.response', a.status_code)
def untop_replies(self, repliesID):
self.log('Untop...')
a = self.ses.delete(f'https://api.codemao.cn/web/forums/replies/{repliesID}/top', headers = self.headers)
self.log('End.response', a.status_code)
def like_replies(self, repliesID):
self.log('liking...')
self.ses.put(f'https://api.codemao.cn/web/forums/comments/{repliesID}/liked?source=REPLY',
headers = self.headers, data = r'{}')
self.log('End.response', a.status_code)
def unlike_replies(self, repliesID):
self.log('Unliking...')
self.ses.delete(f'https://api.codemao.cn/web/forums/comments/{repliesID}/liked?source=REPLY',
headers = self.headers)
2020-06-01T08:43:23 点赞:0
在 论坛管喵,来封我号啊 中回复
GUIMaker文档
menu
GUIMaker | 文档
GuiMaker介绍
GuiMaker的GUI类
GuiMaker介绍
guimaker由1048576,未入门的程序员和Toby共同开发,是一个基于tkinter的简易、轻量级的Python gui。使用它,您可以轻松的写出一个GUI程序。
__init__(self, width=300, height=300, title="Window") width: 宽度 text(self, text="", x=None, y=None, color="black", var=None) text:要显示的文本 button(command, width=20, height=20, text="", x=None, y=None, var=None) text:要显示的文本 run() 使用guimaker必须有且在最后调用run方法2020-06-03T08:04:55 点赞:0
在 彩虹字怎么弄 中回复
<form action=" https://www.qqxiuzi.cn/zh/caihongzi/index.htm" method="post" name="form1">
</form> 彩 虹 字 是 一 组 颜 色 连 续 变 化 的 彩 色 字 体 , 文 章 中 加 入 一 小 段 更 有 特 色
2020-06-03T09:22:21 点赞:0