Python開發運維:Celery連接Redis

目錄

一、理論

1.Celery

二、實驗

1.Windows11安裝Redis

2.Python3.8環境中配置Celery

三、問題

1.Celery命令報錯

2.執行Celery命令報錯

3.Win11啟動Celery報ValueErro錯誤


?

?

?

一、理論

1.Celery

(1) 概念

?Celery是一個基于python開發的分布式系統,它是簡單、靈活且可靠的,處理大量消息,專注于實時處理的異步任務隊列,同時也支持任務調度。

e603186045544c238c4fb2a222ea12e8.jpeg

?

(2) 架構

Celery的架構由三部分組成,消息中間件(message broker),任務執行單元(worker)和任務執行結果存儲(task result store)組成。

1)消息中間件
Celery本身不提供消息服務,但是可以方便的和第三方提供的消息中間件集成。包括,RabbitMQ, Redis等等2)任務執行單元
Worker是Celery提供的任務執行的單元,worker并發的運行在分布式的系統節點中。3)任務結果存儲
Task result store用來存儲Worker執行的任務的結果,Celery支持以不同方式存儲任務的結果,包括AMQP, redis等

5312be781c034a5db52c3796f345803f.png

?

?(3)? 特點

1)簡單
Celery易于使用和維護,并且它不需要配置文件并且配置和使用是比較簡單的2)高可用
當任務執行失敗或執行過程中發生連接中斷,celery會自動嘗試重新執行任務3)快速
單個 Celery 進程每分鐘可處理數以百萬計的任務,而保持往返延遲在亞毫秒級4)靈活
Celery幾乎所有部分都可以擴展或單獨使用,各個部分可以自定義。

?

(4)場景

Celery是一個強大的 分布式任務隊列的異步處理框架,它可以讓任務的執行完全脫離主程序,甚至可以被分配到其他主機上運行。通常使用它來實現異步任務(async task)和定時任務(crontab)。

1)異步任務
將耗時操作任務提交給Celery去異步執行,比如發送短信/郵件、消息推送、音視頻處理等等2)定時任務
定時執行某件事情,比如每天數據統計

?

二、實驗

1.Windows11安裝Redis

(1)下載最新版Redis

Redis-x64-xxx.zip壓縮包到D盤,解壓后,將文件夾重新命名為 Redis

(2)查看目錄

D:\Redis>dir

5ae0dc109bd14283871d6b2729e8b311.png

(3)打開一個 cmd 窗口 使用 cd 命令切換目錄到 D:\Redis 運行

redis-server.exe redis.windows.conf

2a3ce0e66a724e6b82652bcd9542b81c.png

?

(4)把 redis 的路徑加到系統的環境變量

fea7cb630e4b49b1af6995f17dc6f6a0.png

?

(5)另外開啟一個 cmd 窗口,原來的不要關閉,因為先前打開的是redis服務端

?

#切換到 redis 目錄下運行
redis-cli.exe -h 127.0.0.1 -p 6379

2baf1597234a4fac8e7675d55476cfdf.png

(6)檢測連接是否成功

#設置鍵值對
set firstKey 123#取出鍵值對
get firstKey#退出
exit

?

5d02fd34c1e348d19d4230ba1aca676b.png

?

(7)ctrl+c 退出先前打開的服務端

836c461954584108a4b165ef7ea57eae.png

(8)注冊Redis服務

#通過 cmd 命令行工具進入 Redis 安裝目錄,將 Redis 服務注冊到 Windows 服務中,執行以下命令
redis-server.exe --service-install redis.windows.conf --loglevel verbose

8bbbba5f87fa4735bed7bafb9cb497ca.png

(9)啟動Redis服務

#執行以下命令啟動 Redis 服務
redis-server --service-start

650f6e301d1c4d9aa075d9fd1ad05dc6.png

(10)Redis 已經被添加到 Windows 服務中

b77309f2aa214246b83e81213970669e.png

(11)打開Redis服務,將啟動類型設置為自動,即可實現開機自啟動

8cec0e57cda84312a1185fe0c8960edd.png

?

2.Python3.8環境中配置Celery

(1) PyCharm安裝celery+redis

#celery是典型的生產者+消費者的模式,生產者生產任務并加入隊列中,消費者取出任務消費。多用于處理異步任務或者定時任務。#第一種方式
pip install celery
pip install redis#第二種方式
pip install -i https://pypi.douban.com/simple celery
pip install -i https://pypi.douban.com/simple redis

6fcc1ca414684d29a18adaff6ba30620.png

?

(2)新建異步任務執行文件celery_task.py.相當于注冊了celery app

# -*- coding: utf-8 -*-
from celery import Celery
import time
app = Celery('demo', backend='redis://localhost:6379/1', broker='redis://localhost:6379/2')
@app.task
def send_email(name):print("向%s發送郵件..."%name)time.sleep(5)print("向%s發送郵件完成"%name)return "ok"

e2c71ca92a1841818b47e6cb8349db96.png

(3)?在項目文件目錄下創建worker消費任務

PS D:\soft\pythonProject> celery --app=celerypro.celery_task worker -n node1 -l INFO-------------- celery@node1 v5.3.5 (emerald-rush)
--- ***** -----
-- ******* ---- Windows-10-10.0.22621-SP0 2023-11-22 17:26:39
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app:         test:0x1e6fa358550
- ** ---------- .> transport:   redis://127.0.0.1:6379/2
- ** ---------- .> results:     redis://127.0.0.1:6379/1
- *** --- * --- .> concurrency: 32 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ------------------- [queues].> celery           exchange=celery(direct) key=celery[tasks]. celerypro.celery_task.send_email[2023-11-22 17:26:39,265: WARNING/MainProcess] d:\soft\python38\lib\site-packages\celery\worker\consumer\consumer.py:507: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
[2023-11-22 20:30:08,249: INFO/MainProcess] mingle: searching for neighbors
[2023-11-22 20:30:15,379: INFO/MainProcess] mingle: all alone
[2023-11-22 20:30:25,608: INFO/MainProcess] celery@node1 ready.

3c72f0c84b774bc6b4698d3546168029.png

98d51e6e8dd740e495f85fa8298734ca.png

?

(4)ctrl+c 退出

140565377d5a4ff1b3a34f9026d5ae0f.png

(5)修改celery_task.py文件,增加一個task

# -*- coding: utf-8 -*-
from celery import Celery
import time
app = Celery('demo', backend='redis://localhost:6379/1', broker='redis://localhost:6379/2')
@app.task
def send_email(name):print("向%s發送郵件..."%name)time.sleep(5)print("向%s發送郵件完成"%name)return "ok"
@app.task
def send_msg(name):print("向%s發送短信..."%name)time.sleep(5)print("向%s發送郵件完成"%name)return "ok"

66807234d7e64b8891d82f81bea6cc48.png

(6)再次在項目文件目錄下創建worker消費任務

PS D:\soft\pythonProject> celery --app=celerypro.celery_task worker -n node1 -l INFO-------------- celery@node1 v5.3.5 (emerald-rush)
--- ***** ----- 
-- ******* ---- Windows-10-10.0.22621-SP0 2023-11-22 21:01:43
- *** --- * --- 
- ** ---------- [config]
- ** ---------- .> app:         demo:0x29cea446250
- ** ---------- .> transport:   redis://localhost:6379/2
- ** ---------- .> results:     redis://localhost:6379/1
- *** --- * --- .> concurrency: 32 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- -------------- [queues].> celery           exchange=celery(direct) key=celery[tasks]. celerypro.celery_task.send_email. celerypro.celery_task.send_msg[2023-11-22 21:01:43,381: WARNING/MainProcess] d:\soft\python38\lib\site-packages\celery\worker\consumer\consumer.py:507: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
[2023-11-22 21:01:43,612: INFO/SpawnPoolWorker-23] child process 23988 calling self.run()
[2023-11-22 21:01:43,612: INFO/SpawnPoolWorker-17] child process 16184 calling self.run()
[2023-11-22 21:01:43,612: INFO/SpawnPoolWorker-21] child process 22444 calling self.run()
[2023-11-22 21:01:43,612: INFO/SpawnPoolWorker-27] child process 29480 calling self.run()
[2023-11-22 21:01:43,612: INFO/SpawnPoolWorker-24] child process 5844 calling self.run()
[2023-11-22 21:01:43,631: INFO/SpawnPoolWorker-25] child process 8896 calling self.run()
[2023-11-22 21:01:43,634: INFO/SpawnPoolWorker-29] child process 28068 calling self.run()
[2023-11-22 21:01:43,634: INFO/SpawnPoolWorker-28] child process 18952 calling self.run()
[2023-11-22 21:01:43,636: INFO/SpawnPoolWorker-26] child process 13680 calling self.run()
[2023-11-22 21:01:43,638: INFO/SpawnPoolWorker-31] child process 25472 calling self.run()
[2023-11-22 21:01:43,638: INFO/SpawnPoolWorker-30] child process 28688 calling self.run()
[2023-11-22 21:01:43,638: INFO/SpawnPoolWorker-32] child process 10072 calling self.run()
[2023-11-22 21:01:45,401: INFO/MainProcess] Connected to redis://localhost:6379/2
[2023-11-22 21:01:45,401: WARNING/MainProcess] d:\soft\python38\lib\site-packages\celery\worker\consumer\consumer.py:507: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.warnings.warn([2023-11-22 21:01:49,477: INFO/MainProcess] mingle: searching for neighbors
[2023-11-22 21:01:56,607: INFO/MainProcess] mingle: all alone
[2023-11-22 21:02:04,753: INFO/MainProcess] celery@node1 ready.

0c78eaa6c74c494888757c8050c10bd7.png

(6)ctrl+c 退出創建執行任務文件produce_task.py

# -*- coding: utf-8 -*-
from celerypro.celery_task  import send_email,send_msg
result = send_email.delay("david")
print(result.id)
result2 = send_msg.delay("mao")
print(result2.id)

e09e10141a60455ab943cad7e1fae99f.png

?

(7)運行produce_task.py

5521912205114196b1b4c583d983cb37.png

(8)同時取到id值

07f8d1c9596b426c8e87cf9550885939.png

(9)如遇到報錯需要安裝包 eventlet

PS D:\soft\pythonProject> pip install eventlet

8c95c48bc5504bf0b2d648256968509b.png
(10)重新在項目文件目錄下創建worker消費任務

PS D:\soft\pythonProject> celery --app=celerypro.celery_task worker -n node1 -l INFO -P eventlet-------------- celery@node1 v5.3.5 (emerald-rush)
--- ***** -----
-- ******* ---- Windows-10-10.0.22621-SP0 2023-11-22 21:29:34
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app:         demo:0x141511962e0
- ** ---------- .> transport:   redis://localhost:6379/2
- ** ---------- .> results:     redis://localhost:6379/1
- *** --- * --- .> concurrency: 32 (eventlet)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ------------------- [queues].> celery           exchange=celery(direct) key=celery[tasks]. celerypro.celery_task.send_email. celerypro.celery_task.send_msgr_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.warnings.warn([2023-11-22 21:29:48,022: INFO/MainProcess] pidbox: Connected to redis://localhost:6379/2.
[2023-11-22 21:29:52,117: INFO/MainProcess] celery@node1 ready.


b9b48832640a472f8eb3366cdc9fe2dc.png

(11)?運行produce_task.py

5521912205114196b1b4c583d983cb37.png

(12)生成id

007b9689be2b46439d14211b0085d0e3.png

(13)查看任務消息

[2023-11-22 21:30:35,194: INFO/MainProcess] Task celerypro.celery_task.send_email[c1a473d5-49ac-4468-9370-19226f377e00] received
[2023-11-22 21:30:35,195: WARNING/MainProcess] 向david發送郵件...
[2023-11-22 21:30:35,197: INFO/MainProcess] Task celerypro.celery_task.send_msg[de30d70b-9110-4dfb-bcfd-45a61403357f] received
[2023-11-22 21:30:35,198: WARNING/MainProcess] 向mao發送短信...
[2023-11-22 21:30:40,210: WARNING/MainProcess] 向david發送郵件完成
[2023-11-22 21:30:40,210: WARNING/MainProcess] 向mao發送郵件完成
[2023-11-22 21:30:42,270: INFO/MainProcess] Task celerypro.celery_task.send_msg[de30d70b-9110-4dfb-bcfd-45a61403357f] succeeded in 7.063000000001921s: 'ok'
[2023-11-22 21:30:42,270: INFO/MainProcess] Task celerypro.celery_task.send_email[c1a473d5-49ac-4468-9370-19226f377e00] succeeded in 7.063000000001921s: 'ok'

dd07e64e52474ee9a14aeee201e655fd.png

(14)創建py文件:result.py,查看任務執行結果

取第2個id:de30d70b-9110-4dfb-bcfd-45a61403357f

# -*- coding: utf-8 -*-
from celery.result import AsyncResult
from celerypro.celery_task import app
async_result = AsyncResult(id="de30d70b-9110-4dfb-bcfd-45a61403357f", app=app)
if async_result.successful():result = async_result.get()print(result)
elif async_result.failed():print('執行失敗')
elif async_result.status == 'PENDING':print('任務等待中被執行')
elif async_result.status == 'RETRY':print('任務異常后正在重試')
elif async_result.status == 'STARTED':print('任務已經開始被執行')

3cb2468f7ef94b5596325b7a77c40382.png

(15) 運行result.py文件

f4278e4abcf34edc95c652941ef3646f.png

(16)輸出ok

de18aec5d2bf43b4acb8fb91a82b1711.png

?

三、問題

1.Celery命令報錯

(1)報錯

66136da541e742eeb913a0b4ddba106f.png

428d102f7add401fbf1c8c695e690f0e.png

(2)原因分析

celery版本不同命令不同。

查看幫助命令

PS D:\soft\pythonProject> celery --help
Usage: celery [OPTIONS] COMMAND [ARGS]...Celery command entrypoint.Options:-A, --app APPLICATION-b, --broker TEXT--result-backend TEXT--loader TEXT--config TEXT--workdir PATH-C, --no-color-q, --quiet--version--skip-checks          Skip Django core checks on startup. Setting theSKIP_CHECKS environment variable to any non-emptystring will have the same effect.--help                 Show this message and exit.Commands:amqp     AMQP Administration Shell.beat     Start the beat periodic task scheduler.call     Call a task by name.control  Workers remote control.events   Event-stream utilities.graph    The ``celery graph`` command.inspect  Inspect the worker at runtime.list     Get info from broker.logtool  The ``celery logtool`` command.migrate  Migrate tasks from one broker to another.multi    Start multiple worker instances.purge    Erase all messages from all known task queues.report   Shows information useful to include in bug-reports.result   Print the return value for a given task id.shell    Start shell session with convenient access to celery symbols.status   Show list of workers that are online.upgrade  Perform upgrade between versions.worker   Start worker instance.
PS D:\soft\pythonProject> celery  worker --help
Usage: celery worker [OPTIONS]Start worker instance.Examples--------$ celery --app=proj worker -l INFO$ celery -A proj worker -l INFO -Q hipri,lopri$ celery -A proj worker --concurrency=4$ celery -A proj worker --concurrency=1000 -P eventlet$ celery worker --autoscale=10,0Worker Options:-n, --hostname HOSTNAME         Set custom hostname (e.g., 'w1@%%h').Expands: %%h (hostname), %%n (name) and %%d,(domain).-D, --detach                    Start worker as a background process.-S, --statedb PATH              Path to the state database. The extension'.db' may be appended to the filename.-l, --loglevel [DEBUG|INFO|WARNING|ERROR|CRITICAL|FATAL]Logging level.-O, --optimization [default|fair]Apply optimization profile.--prefetch-multiplier <prefetch multiplier>Set custom prefetch multiplier value forthis worker instance.Pool Options:-c, --concurrency <concurrency>Number of child processes processing thequeue.  The default is the number of CPUsavailable on your system.-P, --pool [prefork|eventlet|gevent|solo|processes|threads|custom]Pool implementation.-E, --task-events, --events     Send task-related events that can becaptured by monitors like celery events,celerymon, and others.--time-limit FLOAT              Enables a hard time limit (in secondsint/float) for tasks.--soft-time-limit FLOAT         Enables a soft time limit (in secondsint/float) for tasks.--max-tasks-per-child INTEGER   Maximum number of tasks a pool worker canexecute before it's terminated and replacedby a new worker.--max-memory-per-child INTEGER  Maximum amount of resident memory, in KiB,that may be consumed by a child processbefore it will be replaced by a new one.  Ifa single task causes a child process toexceed this limit, the task will becompleted and the child process will bereplaced afterwards. Default: no limit.--scheduler TEXTDaemonization Options:-f, --logfile TEXT  Log destination; defaults to stderr--pidfile TEXT--uid TEXT--gid TEXT--umask TEXT--executable TEXTOptions:--help  Show this message and exit.

(3)解決方法

修改命令

PS D:\soft\pythonProject> celery --app=celerypro.celery_task worker -n node1 -l INFO

成功

577654ea7a024e639f347a4282e8da16.png

?

2.執行Celery命令報錯

(1)報錯

AttributeError: 'NoneType' object has no attribute 'Redis'

5f0ebb3ce11b46969600d1af9d0a2b31.png

?

(2)原因分析

PyCharm未安裝redis插件。

(3)解決方法

安裝redis插件

d2610162bdb04d24aa06a5941fa820de.png

?

3.Win11啟動Celery報ValueErro錯誤

(1)報錯

Windows 在開發 Celery 異步任務,通過命令?celery --app=celerypro.celery_task worker -n node1 -l INFO?啟動 Celery 服務后正常;

但在使用 delay() 調用任務時會出現以下報錯信息:

Task handler raised error: ValueError('not enough values to unpack (expected 3, got 0)')
?

388cc7dd79524e98b34cfacbe7cb594a.png

(2)原因分析

PyCharm未安裝eventlet

(3)解決方法

安裝包 eventlet

pip install eventlet

6c57942c19d44ded89153a51b9e3e41b.png

通過以下命令啟動服務

celery --app=celerypro.celery_task worker -n node1 -l INFO -P eventlet

0565710b258946c48643a046ea458b0f.png

?

?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/160620.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/160620.shtml
英文地址,請注明出處:http://en.pswp.cn/news/160620.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Linux 命令: cut 和 tr

1. 寫在前面 本文主要介紹&#xff1a;Linux "cut "和 “tr” 命令行實用程序概述&#xff1b; 公眾號&#xff1a; 滑翔的紙飛機 2. Linux 命令&#xff1a; cut “cut” 命令是一種命令行工具&#xff0c;允許我們剪切指定文件或管道數據的部分內容&#xff0c;并…

JSP內置對象

一、request對象 1、訪問請求參數 2、在作用域中管理屬性 3、獲取Cookie 4、解決中文亂碼 5、獲取客戶端信息 6、顯示國際化信息 是一個javax.servlet.http.HttpServletRequest對象 request封裝了用戶瀏覽器提交的信息&#xff0c;因此可以調用相應的方法可以獲取這些封…

優先經驗回放(prioritized experience replay)

prioritized experience replay 思路 優先經驗回放出自ICLR 2016的論文《prioritized experience replay》。 prioritized experience replay的作者們認為&#xff0c;按照一定的優先級來對經驗回放池中的樣本采樣&#xff0c;相比于隨機均勻的從經驗回放池中采樣的效率更高&…

UML建模圖文詳解教程——類圖

版權聲明 本文原創作者&#xff1a;谷哥的小弟作者博客地址&#xff1a;http://blog.csdn.net/lfdfhl本文參考資料&#xff1a;《UML面向對象分析、建模與設計&#xff08;第2版&#xff09;》呂云翔&#xff0c;趙天宇 著 類圖概述 類圖用來描述系統內各種實體的類型以及不同…

Unsupervised MVS論文筆記

Unsupervised MVS論文筆記 摘要1 引言2 相關工作3 實現方法 Tejas Khot and Shubham Agrawal and Shubham Tulsiani and Christoph Mertz and Simon Lucey and Martial Hebert. Tejas Khot and Shubham Agrawal and Shubham Tulsiani and Christoph Mertz and Simon Lucey and …

JAVA小游戲拼圖

第一步是創建項目 項目名自擬 第二部創建個包名 來規范class 然后是創建類 創建一個代碼類 和一個運行類 代碼如下&#xff1a; package heima; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import …

10、信息打點——APP小程序篇抓包封包XP框架反編譯資產提取

APP信息搜集思路 外在——抓包封包——資產安全測試 抓包&#xff08;Fiddle&茶杯&burp&#xff09;封包&#xff08;封包監聽工具&#xff09;&#xff0c;提取資源信息 資產收集——資源提取——ICO、MAD、hash——FOFA等網絡測繪進行資產搜集 外在——功能邏輯 內在…

國際版Amazon Lightsail的功能解析

Amazon Lightsail是一項易于使用的云服務,可為您提供部署應用程序或網站所需的一切,從而實現經濟高效且易于理解的月度計劃。它是部署簡單的工作負載、網站或開始使用亞馬遜云科技的理想選擇。 作為 AWS 免費套餐的一部分&#xff0c;可以免費開始使用 Amazon Lightsail。注冊…

【Python進階】近200頁md文檔14大體系第4篇:Python進程使用詳解(圖文演示)

本文從14大模塊展示了python高級用的應用。分別有Linux命令&#xff0c;多任務編程、網絡編程、Http協議和靜態Web編程、htmlcss、JavaScript、jQuery、MySql數據庫的各種用法、python的閉包和裝飾器、mini-web框架、正則表達式等相關文章的詳細講述。 Python全套筆記直接地址…

PostgreSQL10安裝postgis插件

1.安裝pgsql10 2.下載插件&#xff0c;以Windows為例&#xff0c;地址&#xff1a;Index of /postgis/windows/pg10/ 3.安裝插件&#xff0c;直接安裝&#xff0c;和pgsql的目錄相同即可&#xff0c;一直下一步 4.安裝之后&#xff0c;需要執行sql打開 CREATE EXTENSION po…

028 - STM32學習筆記 - ADC結構體學習(二)

028 - STM32學習筆記 - 結構體學習&#xff08;二&#xff09; 上節對ADC基礎知識進行了學習&#xff0c;這節在了解一下ADC相關的結構體。 一、ADC初始化結構體 在標準庫函數中基本上對于外設都有一個初始化結構體xx_InitTypeDef&#xff08;其中xx為外設名&#xff0c;例如…

Redis設計與實現-數據結構(建設進度17%)

Redis數據結構 引言數據結構stringSDS數據結構原生string的不足 hash 本博客基于《Redis設計與實現》進行整理和補充&#xff0c;該書依賴于Redis 3.0版本&#xff0c;但是Redis6.0版本在一些底層實現上仍然沒有明顯的變動&#xff0c;因此本文將在該書的基礎上&#xff0c;對于…

PostgreSQL基本操作

1.查詢某個表的所在磁盤大小 select pg_size_pretty(pg_relation_size(grb_grid)); 2.插入point類型的記錄 insert into tb_person ("name", "address", "location", "create_time", "area", "girls") values …

Java 兩個線程交替打印1-100

線程題&#xff1a;交替打印1-100 這里演示兩個線程&#xff0c;一個打印奇數&#xff0c;一個打印偶數 方式一&#xff1a;synchronized FixedThreadPool public class example {private static int count 1;private static final Object lock new Object();public stat…

WPF基礎DataGrid控件

WPF DataGrid 是一個用于顯示和編輯表格數據的強大控件。它提供了豐富的功能&#xff0c;包括排序、篩選、分組、編輯、選擇等&#xff0c;使你能夠以類似電子表格的方式呈現和操作數據。 DataGrid 的布局主要由以下部分組成&#xff1a; 列定義 (Columns): DataGrid 列定義了…

YOLO目標檢測——衛星遙感多類別檢測數據集下載分享【含對應voc、coco和yolo三種格式標簽】

實際項目應用&#xff1a;衛星遙感目標檢測數據集說明&#xff1a;衛星遙感多類別檢測數據集&#xff0c;真實場景的高質量圖片數據&#xff0c;數據場景豐富&#xff0c;含網球場、棒球場、籃球場、田徑場、儲罐、車輛、橋、飛機、船等類別標簽說明&#xff1a;使用lableimg標…

2023年【上海市安全員C證】考試及上海市安全員C證找解析

題庫來源&#xff1a;安全生產模擬考試一點通公眾號小程序 2023年上海市安全員C證考試為正在備考上海市安全員C證操作證的學員準備的理論考試專題&#xff0c;每個月更新的上海市安全員C證找解析祝您順利通過上海市安全員C證考試。 1、【多選題】2017年9月頒發的《中共上海市委…

基于STM32的煙霧濃度檢測報警仿真設計(仿真+程序+講解視頻)

這里寫目錄標題 &#x1f4d1;1.主要功能&#x1f4d1;2.仿真&#x1f4d1;3. 程序&#x1f4d1;4. 資料清單&下載鏈接&#x1f4d1;[資料下載鏈接](https://docs.qq.com/doc/DS0VHTmxmUHBtVGVP) 基于STM32的煙霧濃度檢測報警仿真設計(仿真程序講解&#xff09; 仿真圖prot…

【數據結構】B : DS圖應用--最短路徑

B : DS圖應用–最短路徑 文章目錄 B : DS圖應用--最短路徑DescriptionInputOutputSampleInput Output 解題思路&#xff1a;初始化主循環心得&#xff1a; AC代碼 Description 給出一個圖的鄰接矩陣&#xff0c;再給出指定頂點v0&#xff0c;求頂點v0到其他頂點的最短路徑 In…

SkyWalking配置報警推送到企業微信

1、先在企業微信群里創建一個機器人&#xff0c;復制webhook的地址&#xff1a; 2、找到SkyWalking部署位置的alarm-settings.yml文件 編輯&#xff0c;在最后面加上此段配置 &#xff01;&#xff01;&#xff01;一定格式要對&#xff0c;不然一直報警報不出來按照網上指導…