首页 代码片段记录
"代码片段记录" 的相关文章,均在栏目!
  • python get_time_now

    defget_time_now():importtime#获取当前时间戳(含毫秒)timestamp=time.time()#分解为本地时间结构local_time=time.localtime(timestamp)#提取毫秒部分(保留3位...

  • collect-nvidia-log.sh

    诊断收集nvidia显卡信息的脚本#!/bin/bash#输出文件名(带时间戳)LOGFILE="nvidia_diag_$(date+%Y%m%d_%H%M%S).log"echo"🚀开始收集NVIDIAGPU诊断信息..."|tee$L...

  • python 实现汉诺塔控制台程序

    v1.0全局变量结构实现importosimporttimedefclear_console():"""清空控制台内容,根据操作系统类型使用不同命令Windows系统使用cls命令,macOS/Linux系统使用clear命令"""ifos...

  • 常用的算法逻辑

    判断是否是闰年的算法四年一闰,百年不闰,四百年再闰constisLeapYear=(year)=>(year%4===0&&year%100!==0)||year%400===0;获取1到N的连续数字的总和constg...

  • CSharp-FastLogHelper

    namespaceCSharpTest.Helpers;///<summary>///快速输出日志帮助类///</summary>publicstaticclassFastLogHelper{staticFastLo...

  • CSharp-StopWatchHelper

    usingSystem;usingSystem.Collections.Generic;usingSystem.Diagnostics;usingSystem.Linq;usingSystem.Text;usingSystem.Thread...

  • CSharp-EnvironmentHelper

    环境变量帮助类,支持通过环境变量取值,支持string,int,long,bool,usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;...

  • python logging 日志模块使用记录

    importlogging#导入logging模块,用于记录日志defgetConsoleLogger(name="logger"):"""创建并配置一个自定义的日志记录器,用于将日志输出到控制台参数:name(str):日志记录器的名称,...