08 2024 档案

摘要:ImageDraw.Draw 填充区域 在Python的PIL(Python Imaging Library,现在通常称为Pillow)库中,ImageDraw.Draw 对象用于在图像上绘制形状。要填充一个区域,你通常会使用 rectangle、ellipse、polygon 等方法,并指定填充颜 阅读全文
posted @ 2024-08-30 19:12 西北逍遥 阅读(114) 评论(0) 推荐(0) 编辑
摘要:python 计算list的方差 import numpy as np # 假设我们有一个包含数值的列表 data = [1, 2, 3, 4, 5] # 计算均值 mean = np.mean(data) # 计算方差 variance = np.var(data) # 这将使用默认的N-1作为分 阅读全文
posted @ 2024-08-21 18:12 西北逍遥 阅读(195) 评论(0) 推荐(0) 编辑
摘要:if (tcpSocketObj->state()==QAbstractSocket::SocketState::ConnectedState) { qDebug() << "send data:"<<dataStr; tcpSocketObj->write(dataStr.toUtf8()); } 阅读全文
posted @ 2024-08-17 22:49 西北逍遥 阅读(16) 评论(0) 推荐(0) 编辑
摘要:在Qt中,QTcpSocket 类用于TCP网络编程,它提供了丰富的接口来管理TCP连接。要判断 QTcpSocket 的连接状态,可以使用 state() 方法,该方法返回一个 QAbstractSocket::SocketState 枚举值,表示当前的连接状态。 以下是一些常见的连接状态及其对应 阅读全文
posted @ 2024-08-14 21:52 西北逍遥 阅读(356) 评论(0) 推荐(0) 编辑
摘要:python获取当前日期 年月日时分秒 from datetime import datetime now = datetime.now() current_time = now.strftime("%Y-%m-%d %H:%M:%S") ############################## 阅读全文
posted @ 2024-08-13 22:05 西北逍遥 阅读(242) 评论(0) 推荐(0) 编辑
摘要:pyqt5 combox选择事件绑定 import sys from PyQt5.QtWidgets import QApplication, QWidget, QComboBox, QVBoxLayout, QLabel class ComboBoxExample(QWidget): def __ 阅读全文
posted @ 2024-08-12 15:13 西北逍遥 阅读(167) 评论(0) 推荐(0) 编辑
摘要:unity3d 动态改变物体的位置 using UnityEngine; public class MoveObject : MonoBehaviour { void Start() { // GameObject myObject = GameObject.Find("myObject"); if 阅读全文
posted @ 2024-08-11 16:26 西北逍遥 阅读(78) 评论(0) 推荐(0) 编辑
摘要:python 读取文本文件 # 打开文件 with open('myfile.txt', 'r') as file: # 读取文件内容 content = file.read() # 打印文件内容 print(content) ########################## 阅读全文
posted @ 2024-08-10 19:38 西北逍遥 阅读(14) 评论(0) 推荐(0) 编辑
摘要:string currentDate = DateTime.Now.ToString("yyyyMMdd"); Console.WriteLine("Current Date: " + currentDate); ############################## 阅读全文
posted @ 2024-08-09 14:18 西北逍遥 阅读(88) 评论(0) 推荐(0) 编辑
摘要:SELECT w.company, COUNT(DISTINCT d.RFID_ID) AS total_unique_checkins -- 对每个公司,计算不同RFID_ID的打卡次数 FROM t_worker w JOIN t_rfid r ON w.signNum = r.num1 JOI 阅读全文
posted @ 2024-08-08 20:49 西北逍遥 阅读(6) 评论(0) 推荐(0) 编辑
摘要:python 逐行读取文本文件 # 打开文件 with open('myfile.txt', 'r') as file: # 逐行读取文件内容 for line in file: print(line, end='') # 注意,print 函数默认会在每行末尾添加换行符,所以这里使用 end='' 阅读全文
posted @ 2024-08-07 20:22 西北逍遥 阅读(23) 评论(0) 推荐(0) 编辑
摘要:python 写入文本文件 # 打开文件,如果文件不存在则创建它 with open('myfile.txt', 'w') as file: # 写入内容 file.write('kkkkkkkkkkkkkkkkkkk!\n') ################################### 阅读全文
posted @ 2024-08-06 18:48 西北逍遥 阅读(22) 评论(0) 推荐(0) 编辑
摘要:public class CharCountExample { public static void main(String[] args) { String text = "Hello, world! How are you?"; char targetChar = 'o'; int count 阅读全文
posted @ 2024-08-05 19:05 西北逍遥 阅读(64) 评论(0) 推荐(0) 编辑
摘要:#include <QDate> #include <QString> #include <QDebug> int main() { // 创建一个QDate对象 QDate date(2023, 4, 5); // 假设日期是2023年4月5日 // 使用toString()方法将日期格式化为yy 阅读全文
posted @ 2024-08-04 13:49 西北逍遥 阅读(19) 评论(0) 推荐(0) 编辑
摘要:python 追加到文本文件 # 打开文件以追加内容 with open('myfile.txt', 'a') as file: # 追加内容 file.write('kkkkkkkkkkkkkkkkkkkkk.\n') ################################# 阅读全文
posted @ 2024-08-03 19:35 西北逍遥 阅读(14) 评论(0) 推荐(0) 编辑
摘要:using System.IO; using UnityEngine; using UnityEngine.UI; public class SaveRawImageAsPNG : MonoBehaviour { public RawImage rawImage; public void SaveI 阅读全文
posted @ 2024-08-01 15:25 西北逍遥 阅读(31) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示