只是个人学习的时候的一些笔记,如果有什么错误的地方还请各位勿喷,手下留情,期待您的指正。 定期会更新文章到blog.sea-whales.cn我的个人网站中,有兴趣的小伙伴可以进来看看
我们先来做一个初始画板,先不添加其他复杂元素,来实现能写字的功能:
python# !/usr/bin/env python3
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Line, Color
class DrawCanvasWidget(Widget):
def __init__(self, **kwargs):
super(DrawCanvasWidget, self).__init__(**kwargs)
"""设置画笔的默认颜色为黑色"""
self.canvas.add(Color(rgb=[0, 0, 0]))
self.line_width = 2
def on_touch_down(self, touch):
"""触摸显示轨迹"""
if Widget.on_touch_down(self, touch):
return
with self.canvas:
touch.ud['current_line'] = Line(points=(touch.x, touch.y), width=self.line_width)
def on_touch_move(self, touch):
"""连线"""
if 'current_line' in touch.ud:
touch.ud['current_line'].points += (touch.x, touch.y)
class PaintApp(App):
def build(self):
self.draw_canvas_widget = DrawCanvasWidget()
return self.draw_canvas_widget
if __name__ == '__main__':
PaintApp().run()
当你在安装 mysqlclient 时遇到 Exception: Can not find valid pkg-config name. 错误,通常是因为系统缺少必要的开发库或环境变量未正确设置。以下是解决这个问题的步骤:
确保你已经安装了 MariaDB 的开发库。根据你的操作系统,使用相应的包管理器来安装这些库。
bashsudo apt-get update sudo apt-get install python3-dev default-libmysqlclient-dev libssl-dev
bashsudo yum install python3-devel mariadb-devel
在 Linux 系统中,你可以将 AList 管理的存储(如本地磁盘、SMB/NFS 共享、云存储等)挂载到本地文件系统,使其像普通目录一样访问。以下是几种实现方法:
在 IPMI 中,使用 ipmitool sensor thresh 修改传感器的阈值时,不同传感器的可修改范围和生效方式可能不同,并不完全一致。以下是关键点分析:
并非所有传感器都允许修改阈值
CPU Status、PSU Status)是状态型传感器,无法修改阈值。ipmitool sensor list 查看传感器的 Threshold Readable 字段(若为 Yes 则可修改)。不同厂商的 BMC 实现可能不同
Inlet Temp 允许修改,但 CPU Temp 可能被锁定。在部分Linux实例中,由于Security-Enhanced Linux(SELinux)安全策略的限制,可能导致SSH远程连接异常,表现为:
AVC (Access Vector Cache)拒绝记录该问题通常发生在SELinux处于Enforcing(强制模式)时,由于策略限制导致SSH服务无法正常访问所需资源。