Windows 下搭建 Zephyr 开发环境

1. 系统要求

  • 操作系统:Windows 10/11(64位)
  • 磁盘空间:至少 8GB 可用空间(Zephyr 及其工具链较大)
  • 权限:管理员权限(部分工具需要)

 2. 安装必要工具

winget安装依赖工具(Windows Package Manager)

管理员身份 打开 cmd.exe或者PowerShell,运行:

winget install Kitware.CMake Ninja-build.Ninja oss-winget.gperf python Git.Git oss-winget.dtc wget 7zip.7zip

windows安装包下载临时目录

C:\Users\Administrator\AppData\Local\Temp\WinGet

安装日志:

Microsoft Windows [版本 10.0.26100.4061]
(c) Microsoft Corporation。保留所有权利。C:\Users\Administrator>winget install Kitware.CMake Ninja-build.Ninja oss-winget.gperf python Git.Git oss-winget.dtc wget 7zip.7zip
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: Kitware.CMake
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: Ninja-build.Ninja
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: oss-winget.gperf
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: python
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: Git.Git
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: oss-winget.dtc
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: wget
找到已安装的现有包。正在尝试升级已安装的包...
找不到可用的升级。
配置的源中没有可用的较新的包版本。
已安装程序包: 7zip.7zip

3. 获取Zephyr和安装Python依赖项

1. 使用普通用户打开cmd.exe or PowerShell 终端

2. 创建新的虚拟环境

cd D:\workspace\
mkdir zephyrproject
python -m venv zephyrproject\.venv

3. 激活虚拟环境

zephyrproject\.venv\Scripts\activate.bat

4.  安装west

pip install west -i https://pypi.mirrors.ustc.edu.cn/simple/

5. 获取Zephyr源码

west init zephyr-project
cd zephyr-project
west update

 west update日志

(.venv) D:\workspace\zephyrproject\zephyr-project>west update
=== updating acpica (modules/lib/acpica):
HEAD is now at 8d24867bc Merge pull request #5 from dcpleung/kernel/mm_z_phys_map_unmap_rename
=== updating cmsis (modules/hal/cmsis):
HEAD is now at d1b8b20 Backport CMSIS_6#102 to CMSIS 5.9.0
=== updating cmsis-dsp (modules/lib/cmsis-dsp):
HEAD is now at d80a49b2 do not generate warnings when scalar functions are used with MVE
=== updating cmsis-nn (modules/lib/cmsis-nn):
HEAD is now at e9328d6 manifest: zephyr module file
=== updating cmsis_6 (modules/hal/cmsis_6):
HEAD is now at 6dd50439 cmsis_6: Integrate with zephyr build system
=== updating edtt (tools/edtt):
HEAD is now at b9ca3c7 Fix for for python >= 3.11
=== updating fatfs (modules/fs/fatfs):
HEAD is now at 16245c7 fs: Update driver to version 0.15a
=== updating hal_adi (modules/hal/adi):
HEAD is now at f8f6547 chore(PeriphDrivers): Replace pow() with left shift in UART drivers
=== updating hal_afbr (modules/hal/afbr):
HEAD is now at 4e1eea7 general: MAKE_VERSION is defined in other modules so let's change it
=== updating hal_ambiq (modules/hal/ambiq):
HEAD is now at f46941f hal: uart: minor change for uart dma support
=== updating hal_atmel (modules/hal/atmel):
HEAD is now at ca7e4c6 sam3x: spi: missing adc macro
=== updating hal_bouffalolab (modules/hal/bouffalolab):
HEAD is now at 5811738 bflb: add register files for bl60x
=== updating hal_espressif (modules/hal/espressif):
HEAD is now at 1f1d6937f8 hal: esp32c6: Fix sleep routine
=== updating hal_ethos_u (modules/hal/ethos_u):
HEAD is now at 50ddffc Cache optimizations
=== updating hal_gigadevice (modules/hal/gigadevice):
HEAD is now at 2994b7d README.md: add pllmf and pack exception for gd32a50x
=== updating hal_infineon (modules/hal/infineon):
HEAD is now at 0fe4f3a hal: infineon: Modifications required to support XMC7200
=== updating hal_intel (modules/hal/intel):
HEAD is now at 0447cd2 Update pm_regs.h
=== updating hal_microchip (modules/hal/microchip):
HEAD is now at 4b74f40 hal: microchip: sam: Update some register definitions for FLEXCOM USART
=== updating hal_nordic (modules/hal/nordic):
HEAD is now at 4eafaa4 nrfs: usb vbus enable/disable: expand usb service
=== updating hal_nuvoton (modules/hal/nuvoton):
HEAD is now at be1042d hal:nuvoton:m55m1: support emac
=== updating hal_nxp (modules/hal/nxp):
HEAD is now at e0b43431 dts: nxp: nxp_imx: update the pinctrl dtsi for mimx9131cvvxj
=== updating hal_openisa (modules/hal/openisa):
HEAD is now at eabd530 fix-double-promotion in fsl_xcvr_trim
=== updating hal_quicklogic (modules/hal/quicklogic):
HEAD is now at bad8944 HAL: eoss3_dev: add missing `__cplusplus` handling
=== updating hal_renesas (modules/hal/renesas):
HEAD is now at 9d68ee7 portable: rp_crc: add runtime reconfigure for CRC
=== updating hal_rpi_pico (modules/hal/rpi_pico):
HEAD is now at 7b57b24 Merge pull request #8 from ajf58/merge-2.1.0
=== updating hal_silabs (modules/hal/silabs):
HEAD is now at a0095a7 wiseconnect: Apply 802.11ax config only in client mode
=== updating hal_st (modules/hal/st):
HEAD is now at 9f81b44 sensor/stmemsc: Align stmemsc i/f to v2.9.1
=== updating hal_stm32 (modules/hal/stm32):
HEAD is now at 5cbc642b dts: New batch with HSPI signals
=== updating hal_tdk (modules/hal/tdk):
HEAD is now at 6727477 Merge pull request #8 from tdk-invn-oss/main
=== updating hal_telink (modules/hal/telink):
HEAD is now at 4226c7f drivers: Disable BLE support
=== updating hal_ti (modules/hal/ti):
HEAD is now at bc8e7b9 hal: ti: mspm0: Add a support for MSPM0
=== updating hal_wch (modules/hal/wch):
HEAD is now at 6dd3137 hal: wch: update the HAL to pull in CH32V00x support
=== updating hal_wurthelektronik (modules/hal/wurthelektronik):
HEAD is now at e3e2797 Remove preprocessor warnings for not enabling float
=== updating hal_xtensa (modules/hal/xtensa):
HEAD is now at b38620c zephyr: Add SoC overlay for i.MXRT700 HiFi1 DSP
=== updating hostap (modules/lib/hostap):
HEAD is now at 8412f4b23 [noup] zephyr: remove zephyr wpas monitor socket pair
=== updating liblc3 (modules/lib/liblc3):
HEAD is now at 48bbd3e Rename lc3 python package to lc3py, and bump version to 1.1.2
=== updating libmctp (modules/lib/libmctp):
HEAD is now at b97860e build MCTP zephyr library only when CONFIG_MCTP is enabled
=== updating libmetal (modules/hal/libmetal):
HEAD is now at 14f5195 lib: update libmetal to SHA 9a21915a5f8f
=== updating littlefs (modules/fs/littlefs):
HEAD is now at 8f5ca34 Merge pull request #19 from mkaranki/update-to-v2.10.2
=== updating loramac-node (modules/lib/loramac-node):
HEAD is now at fb00b383 zephyr: configure FragDecoder using Kconfig
=== updating lvgl (modules/lib/gui/lvgl):
HEAD is now at 1ed1ddd88 docs(Alif): add docs for Alif chip vendor (#7622)
=== updating mbedtls (modules/crypto/mbedtls):
HEAD is now at 5f8899343 Merge pull request #70 from tomi-font/bump_to_3.6.3
=== updating mcuboot (bootloader/mcuboot):
HEAD is now at 990b1fcb docs: release-notes: Add additional fixes
=== updating mipi-sys-t (modules/debug/mipi-sys-t):
HEAD is now at 33e5c23 Fix for warning of potential error using = instead of ==
=== updating net-tools (tools/net-tools):
HEAD is now at 986bfeb Replace native_posix with native_sim
=== updating nrf_hw_models (modules/bsim_hw_models/nrf_hw_models):
HEAD is now at c6296f6 52/53 CCM: Remove warning on TASK_STOP
=== updating nrf_wifi (modules/lib/nrf_wifi):
HEAD is now at 0cd7f28 Fix delayed stats event handling
=== updating open-amp (modules/lib/open-amp):
HEAD is now at f7f4d08 lib: update open-amp lib  to SHA 9a21915a5f8f
=== updating openthread (modules/lib/openthread):
HEAD is now at 3ae741f95 [instance] fix index computation in multi-instances context (#11099)
=== updating percepio (modules/debug/percepio):
HEAD is now at 49e6dc2 Merge branch 'main' into zephyr
=== updating picolibc (modules/lib/picolibc):
HEAD is now at 560946f26 Delete obsoleted _syslist.h
=== updating segger (modules/debug/segger):
HEAD is now at cf56b1d readme: Add readme
=== updating tinycrypt (modules/crypto/tinycrypt):
HEAD is now at 1012a3e Fix warnings reported by UBSAN
=== updating trusted-firmware-a (modules/tee/tf-a/trusted-firmware-a):
HEAD is now at 713ffbf96 Merge pull request #4 from ceolin/v2.10.4
=== updating trusted-firmware-m (modules/tee/tf-m/trusted-firmware-m):
HEAD is now at c150f4885 platform: ext: adi: pull in update from TF-M main
=== updating uoscore-uedhoc (modules/lib/uoscore-uedhoc):
HEAD is now at 54abc10 Merge pull request #5 from rlubos/upmerge-02-2025
=== updating zcbor (modules/lib/zcbor):
HEAD is now at 9b07780 Update version to 0.9.1

 6. Export Zephyr package

west zephyr-export

7. 安装west python依赖包

# 使用国外镜像源比较慢
west packages pip --install

 注意:永久切换pip使用国内镜像源

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cnpip config list
# 恢复默认配置
pip config unset global.index-url
pip config unset global.trusted-host

常见镜像源地址

镜像名称

URL

清华大学

https://pypi.tuna.tsinghua.edu.cn/simple

阿里云

https://mirrors.aliyun.com/pypi/simple

腾讯云

https://mirrors.cloud.tencent.com/pypi/simple

华为云

https://repo.huaweicloud.com/repository/pypi/simple

4. 安装 Zephyr SDK

Zephyr SDK 包含编译工具链(如 GCC ARM 工具链)。

(1) 下载 SDK

从 Zephyr SDK 官方页面 下载最新版(如 zephyr-sdk-0.17.1_windows-x86_64.7z)。

(2) 解压并安装

1. 解压到 D:\workspace\zephyrproject\zephyr-sdk\zephyr-sdk-0.17.1(路径不要有空格或中文)。

以管理员身份运行解压目录中的 setup.cmd

cd D:\workspace\zephyrproject\zephyr-sdk\zephyr-sdk-0.17.1
.\setup.cmd

2. 按提示输入 Y 同意安装。

验证安装

(1) 检查环境

west --version
cmake --version
ninja --version
python --version# 所有命令应正常输出版本号
(.venv) D:\workspace\zephyrproject\zephyr-project\zephyr>west --version
West version: v1.4.0(.venv) D:\workspace\zephyrproject\zephyr-project\zephyr>cmake --version
cmake version 4.0.2CMake suite maintained and supported by Kitware (kitware.com/cmake).(.venv) D:\workspace\zephyrproject\zephyr-project\zephyr>ninja --version
1.12.1(.venv) D:\workspace\zephyrproject\zephyr-project\zephyr>python --version
Python 3.10.11

(2) 编译示例项目

cd D:\workspace\zephyrproject\zephyr-project\zephyr
west build -b blackpill_f401cc samples/hello_world
  • -b blackpill_f401cc:指定 Black Pill STM32F401CC 开发板
  • 首次编译会下载工具链和依赖,耗时较长。

(3) 烧录与调试

west flash --runner blackmagicprobe --gdb-serial "\\.\COM12"
west debug --runner blackmagicprobe --gdb-serial "\\.\COM12"
west attach --runner blackmagicprobe --gdb-serial "\\.\COM12"west flash --runner blackmagicprobe --gdb-serial "\\.\COM12"
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner blackmagicprobe
-- runners.blackmagicprobe: using GDB serial: \\.\COM12
Remote debugging using \\.\COM12
Target voltage: 2.51V
Available Targets:
No. Att Driver
1      STM32F401E M4
Attaching to Remote target
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x08002d22 in ?? ()
Loading section rom_start, size 0x194 lma 0x8000000
Loading section text, size 0x367c lma 0x8000194
Loading section .ARM.exidx, size 0x8 lma 0x8003810
Loading section initlevel, size 0x80 lma 0x8003818
Loading section device_area, size 0x180 lma 0x8003898
Loading section sw_isr_table, size 0x2a8 lma 0x8003a18
Loading section gpio_driver_api_area, size 0x24 lma 0x8003cc0
Loading section reset_driver_api_area, size 0x10 lma 0x8003ce4
Loading section clock_control_driver_api_area, size 0x1c lma 0x8003cf4
Loading section uart_driver_api_area, size 0x4c lma 0x8003d10
Loading section rodata, size 0x2d4 lma 0x8003d5c
Loading section datas, size 0x4c lma 0x8004030
Loading section device_states, size 0x18 lma 0x800407c
Loading section .last_section, size 0x4 lma 0x8004094
Start address 0x080008c4, load size 16536
Transfer rate: 23 KB/sec, 590 bytes/write.
[Inferior 1 (Remote target) killed]west debug --runner blackmagicprobe --gdb-serial "\\.\COM12"
-- west debug: rebuilding
ninja: no work to do.
-- west debug: using runner blackmagicprobe
-- runners.blackmagicprobe: using GDB serial: \\.\COM12
GNU gdb (Zephyr SDK 0.17.1) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-host_w64-mingw32 --target=arm-zephyr-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://github.com/zephyrproject-rtos/sdk-ng/issues>.
Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type "help".
Type "apropos word" to search for commands related to "word".
Remote debugging using \\.\COM12
Target voltage: 2.44V
Available Targets:
No. Att Driver1      STM32F401E M4
Attaching to Remote target
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x08002d22 in ?? ()
Reading symbols from D:/workspace/zephyrproject/zephyr-project/zephyr/build/zephyr/zephyr.elf...
Loading section rom_start, size 0x194 lma 0x8000000
Loading section text, size 0x367c lma 0x8000194
Loading section .ARM.exidx, size 0x8 lma 0x8003810
Loading section initlevel, size 0x80 lma 0x8003818
Loading section device_area, size 0x180 lma 0x8003898
Loading section sw_isr_table, size 0x2a8 lma 0x8003a18
Loading section gpio_driver_api_area, size 0x24 lma 0x8003cc0
Loading section reset_driver_api_area, size 0x10 lma 0x8003ce4
Loading section clock_control_driver_api_area, size 0x1c lma 0x8003cf4
Loading section uart_driver_api_area, size 0x4c lma 0x8003d10
Loading section rodata, size 0x2d4 lma 0x8003d5c
--Type <RET> for more, q to quit, c to continue without paging--
Loading section datas, size 0x4c lma 0x8004030
Loading section device_states, size 0x18 lma 0x800407c
Loading section .last_section, size 0x4 lma 0x8004094
Start address 0x080008c4, load size 16536
Transfer rate: 6 KB/sec, 590 bytes/write.west attach --runner blackmagicprobe --gdb-serial "\\.\COM12"
-- west attach: rebuilding
ninja: no work to do.
-- west attach: using runner blackmagicprobe
-- runners.blackmagicprobe: using GDB serial: \\.\COM12
GNU gdb (Zephyr SDK 0.17.1) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-host_w64-mingw32 --target=arm-zephyr-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://github.com/zephyrproject-rtos/sdk-ng/issues>.
Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type "help".
Type "apropos word" to search for commands related to "word".
Remote debugging using \\.\COM12
Target voltage: 2.53V
Available Targets:
No. Att Driver1      STM32F401E M4
Attaching to Remote target
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x08002d22 in ?? ()
Reading symbols from D:/workspace/zephyrproject/zephyr-project/zephyr/build/zephyr/zephyr.elf...
(gdb)

如果看到 Hello World! zephyr 输出,说明环境搭建成功!

这里主要使用的是开源调试器Black Magic Debug,Black Magic Debug自带Debug口和串口,使用windows命令行请注意:

COM 端口号过高(> COM9)
  • 问题原因:Windows 对 COM 端口号的命名规则有特殊限制:
    • COM1~COM9 是传统端口,可直接以 COMx 形式访问。
    • COM10 及以上的端口属于扩展端口,需通过 \\.\COMx 格式访问(例如 \\.\COM12)。

    本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.pswp.cn/pingmian/83991.shtml

    如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

    相关文章

    三分算法与DeepSeek辅助证明是单峰函数

    前置 单峰函数有唯一的最大值&#xff0c;最大值左侧的数值严格单调递增&#xff0c;最大值右侧的数值严格单调递减。 单谷函数有唯一的最小值&#xff0c;最小值左侧的数值严格单调递减&#xff0c;最小值右侧的数值严格单调递增。 三分的本质 三分和二分一样都是通过不断缩…

    安全月报 | 傲盾DDoS攻击防御2025年5月简报

    引言 在2025年5月&#xff0c;全球数字化进程高歌猛进&#xff0c;各行各业深度融入数字浪潮&#xff0c;人工智能、物联网、大数据等前沿技术蓬勃发展&#xff0c;进一步夯实了数字经济的基石。然而&#xff0c;在这看似繁荣的数字生态背后&#xff0c;网络安全威胁正以惊人的…

    【Spring】Spring哪些源码解决了哪些问题P1

    欢迎来到啾啾的博客&#x1f431;。 记录学习点滴。分享工作思考和实用技巧&#xff0c;偶尔也分享一些杂谈&#x1f4ac;。 有很多很多不足的地方&#xff0c;欢迎评论交流&#xff0c;感谢您的阅读和评论&#x1f604;。 目录 Spring是怎么处理请求的&#xff1f;Spring请求方…

    坚持每日Codeforces三题挑战:Day 4 - 题目详解(2025-06-07,难度:1000, 1100, 1400)

    前言&#xff1a; 此文章主要是记录每天的codeforces刷题&#xff0c;还有就是给其他打算法竞赛的人一点点点点小小的帮助&#xff08;毕竟现在实力比较菜&#xff0c;题目比较简单&#xff0c;但我还是会认真写题解&#xff09;。 之前忙学校事情&#xff0c;懈怠了一段时间…

    6.7本日总结

    一、英语 复习默写list10list19&#xff0c;07年第3篇阅读 二、数学 学习线代第一讲&#xff0c;写15讲课后题 三、408 学习计组第二章&#xff0c;写计组习题 四、总结 本周结束线代第一讲和计组第二章&#xff0c;之后学习计网4.4&#xff0c;学完计网4.4之后开操作系…

    PGSR : 基于平面的高斯溅射高保真表面重建【全流程分析与测试!】【2025最新版!!】

    【PGSR】: 基于平面的高斯溅射高保真表面重建 前言 三维表面重建是计算机视觉和计算机图形学领域的核心问题之一。随着Neural Radiance Fields (NeRF)和3D Gaussian Splatting (3DGS)技术的发展&#xff0c;从多视角RGB图像重建高质量三维表面成为了研究热点。今天我们要深入…

    从认识AI开始-----AutoEncoder:生成模型的起点

    前言 从15年开始&#xff0c;在深度学习的重要模型中&#xff0c;AutoEncoder&#xff08;自编码器&#xff09;可以说是打开生成模型世界的起点。它不仅是压缩与重建的工具&#xff0c;更是VAE、GAN、DIffusion等复杂生成模型的思想起源。其实AutoEncoder并不复杂&#xff0c;…

    解决MySQL8.4报错ERROR 1524 (HY000): Plugin ‘mysql_native_password‘ is not loaded

    最近使用了MySQL8.4 , 服务启动成功,但是就是无法登陆,并且报错: ERROR 1524 (HY000): Plugin mysql_native_password is not loaded 使用如下的命令也报错 mysql -u root -p -P 3306 问题分析: 在MySQL 8.0版本中,默认的认证插件从mysql_native_password变更为cachi…

    TDengine 开发指南——无模式写入

    简介 在物联网应用中&#xff0c;为了实现自动化管理、业务分析和设备监控等多种功能&#xff0c;通常需要采集大量的数据项。然而&#xff0c;由于应用逻辑的版本升级和设备自身的硬件调整等原因&#xff0c;数据采集项可能会频繁发生变化。为了应对这种挑战&#xff0c;TDen…

    嵌入式面试高频(5)!!!C++语言(嵌入式八股文,嵌入式面经)

    一、C有几种传值方式之间的区别 一、值传递&#xff08;Pass by Value&#xff09; 机制&#xff1a;创建参数的副本&#xff0c;函数内操作不影响原始数据语法&#xff1a;void func(int x)特点&#xff1a; 数据安全&#xff1a;原始数据不受影响性能开销&#xff1a;需要复…

    Spark 之 AQE

    个人其他链接 AQE 执行顺序https://blog.csdn.net/zhixingheyi_tian/article/details/125112793 AQE 产生 AQE 的 循环触发点 src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala override def doExecute(): RDD[InternalRow] = {withFin…

    FSMC扩展外部SRAM

    提示&#xff1a;文章 文章目录 前言一、背景二、2.12.2 三、3.1 总结 前言 前期疑问&#xff1a; 本文目标&#xff1a; 一、背景 2025年6月7日 19:34:48 今天看了FSMC扩展外部SRAM的文章&#xff0c;大概理解到stm32除了内部存储器&#xff0c;还可以扩展外部存储器。其中s…

    【CSS-6】深入理解CSS复合选择器:提升样式表的精确性与效率

    CSS选择器是前端开发的基石&#xff0c;而复合选择器则是其中最强大且实用的工具之一。本文将全面解析CSS复合选择器的类型、用法、优先级规则以及最佳实践&#xff0c;帮助你编写更高效、更精确的样式表。 1. 什么是复合选择器&#xff1f; 复合选择器是通过组合多个简单选择…

    使用python实现奔跑的线条效果

    效果&#xff0c;展示&#xff08;视频效果展示&#xff09;&#xff1a; 奔跑的线条 from turtle import * import time t1Turtle() t2Turtle() t3Turtle() t1.hideturtle() t2.hideturtle() t3.hideturtle() t1.pencolor("red") t2.pencolor("green") t3…

    从零搭建uniapp项目

    目录 创建uni-app项目 基础架构 安装 uni-ui 组件库 安装sass依赖 easycom配置组件自动导入 配置view等标签高亮声明 配置uni-ui组件类型声明 解决 标签 错误 关于tsconfig.json中提示报错 关于非原生标签错误&#xff08;看运气&#xff09; 安装 uview-plus 组件库…

    Redis主从复制的原理一 之 概述

    概述 本文概要性的介绍了Redis主从复制原理&#xff0c;及新旧版本主从复制的区别&#xff0c;优缺点。具体的主从复制过程可详见「Redis主从复制原理二 之 主从复制工作流程」 旧版主从复制的实现 Redis的复制功能分为 同步&#xff08;sync&#xff09;和 命令传播&#xff…

    网络原理 4-TCP3

    上篇文章&#xff0c;我们讲了TCP协议的连接管理&#xff08;”三次握手“和”四次挥手“的过程&#xff09;。 4、滑动窗口 这个滑动窗口是TCP中非常有特点的机制。我们知道&#xff0c;TCP是通过前面讲的三个机制&#xff1a;确认应答&#xff0c;超时重传&#xff0c;连接…

    【使用 Loki + Promtail + Grafana 搭建轻量级容器日志分析平台】

    使用 Loki Promtail Grafana 搭建轻量级容器日志分析平台 摘要 本文介绍如何通过 Docker Compose 快速搭建 Loki 日志存储、Promtail 日志采集和 Grafana 日志可视化/告警的完整流程。用最小化示例演示核心配置、常见问题排查和告警规则设置&#xff0c;帮助读者快速上手。…

    CRMEB 中 PHP 快递查询扩展实现:涵盖一号通、阿里云、腾讯云

    目前已有一号通快递查询、阿里云快递查询扩展 扩展入口文件 文件目录 crmeb\services\express\Express.php 默认一号通快递查询 namespace crmeb\services\express;use crmeb\basic\BaseManager; use crmeb\services\AccessTokenServeService; use think\Container; use thi…

    使用 Python 自动化 Word 文档样式复制与内容生成

    在办公自动化领域&#xff0c;如何高效地处理 Word 文档的样式和内容复制是一个常见需求。本文将通过一个完整的代码示例&#xff0c;展示如何利用 Python 的 python-docx 库实现 Word 文档样式的深度复制 和 动态内容生成&#xff0c;并结合知识库中的最佳实践优化文档处理流程…