python 估计电池寿命计算器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 估计电池寿命计算器相关的知识,希望对你有一定的参考价值。
# -*- coding: utf-8 -*-
# Formula = mAh ÷ mA * 0.7 = estmated hours
import subprocess
import time
minute = 1
hour = minute * 60
day = hour * 24 / 60
week = day * 7
year = week * 52
def banner():
subprocess.call("clear")
print ""
print " ╔════════════════╗"
print " ║████████████████╚╗"
print " ║████ Est Bat ███ ║"
print " ║████████████████╔╝"
print " ╚════════════════╝"
print ""
print " - Estimated Battery life - \n"
def est_battery():
print "Enter the following information..."
time.sleep(1.5)
banner()
battery_capacity = int(raw_input('Battery Capacity(mAh): '))
device_consumption = int(raw_input('Current Load(mA): '))
formular = (battery_capacity / device_consumption * 0.7)
estimated_life = str(formular)
estimated_days = str(round(formular / 24, 1))
print ""
print "Estimated battery life is " + estimated_life + " hours."
if formular > 24:
print "Estimated battery life is " + estimated_days + " days.\n"
def main():
banner()
est_battery()
main()
以上是关于python 估计电池寿命计算器的主要内容,如果未能解决你的问题,请参考以下文章
锂离子电池健康状态估计基于粒子滤波算法的锂电池剩余使用寿命预测,python+Matlab
在 iOS 中计算电池寿命
如何计算电池寿命百分比 - android [重复]
理解 与 计算 物联网产品的电池使用寿命
Python数据分析案例24——基于深度学习的锂电池寿命预测
贪心算法之电池的寿命