Status.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:jasper-modules 作者: mattcurrycom 项目源码 文件源码
def handle(text, mic, profile):
    os, name, version, _, _, _ = platform.uname()
    version = version.split('-')[0]
    cores = psutil.cpu_count()
    cpu_percent = psutil.cpu_percent()
    memory_percent = psutil.virtual_memory()[2]
    disk_percent = psutil.disk_usage('/')[3]
    boot_time = datetime.datetime.fromtimestamp(psutil.boot_time())
    running_since = boot_time.strftime("%A %d. %B %Y")
    response = "I am currently running on %s version %s.  " %(os, version)
    response += "This system is named %s and has %s CPU cores.  " %(name, cores)
    response += "Current CPU utilization is %s percent.  " %cpu_percent
    response += "Current memory utilization is %s percent." %memory_percent
    mic.say(response)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号