def get_current_charge():
    try:
        with open('/sys/class/power_supply/BAT0/charge_now') as f:
            return int(f.readline())
    except IOError:
        print('Cannot find current battery charge.')
        return 0
def get_current_charge():
    try:
        with open('/sys/class/power_supply/BAT0/charge_now') as f:
            return int(f.readline())
    except IOError:
        print('Cannot find current battery charge.')
        return 0