#!/usr/bin/env python

import logging
from ina219 import INA219

SHUNT_OHMS = 0.1
MAX_EXPECTED_AMPS = 0.2


def read():
    ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO)
    ina.configure(ina.RANGE_16V, ina.GAIN_AUTO)

    print("Bus Voltage    : %.3f V" % ina.voltage())
    print("Bus Current    : %.3f mA" % ina.current())
    print("Supply Voltage : %.3f V" % ina.supply_voltage())
    print("Shunt voltage  : %.3f mV" % ina.shunt_voltage())
    print("Power          : %.3f mW" % ina.power())


if __name__ == "__main__":
    read()

#!/usr/bin/env python

import logging
from ina219 import INA219

SHUNT_OHMS = 0.1
MAX_EXPECTED_AMPS = 0.2


def read():
    ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO)
    ina.configure(ina.RANGE_16V, ina.GAIN_AUTO)

    print ("Bus Voltage    : %.3f V" % ina.voltage())
    print ("Bus Current    : %.3f mA" % ina.current())
    print ("Supply Voltage : %.3f V" % ina.supply_voltage())
    print ("Shunt voltage  : %.3f mV" % ina.shunt_voltage())
    print ("Power          : %.3f mW" % ina.power())


if __name__ == "__main__":
    read()

--- 
+++ 
@@ -11,11 +11,11 @@
     ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO)
     ina.configure(ina.RANGE_16V, ina.GAIN_AUTO)
 
-    print ("Bus Voltage    : %.3f V" % ina.voltage())
-    print ("Bus Current    : %.3f mA" % ina.current())
-    print ("Supply Voltage : %.3f V" % ina.supply_voltage())
-    print ("Shunt voltage  : %.3f mV" % ina.shunt_voltage())
-    print ("Power          : %.3f mW" % ina.power())
+    print("Bus Voltage    : %.3f V" % ina.voltage())
+    print("Bus Current    : %.3f mA" % ina.current())
+    print("Supply Voltage : %.3f V" % ina.supply_voltage())
+    print("Shunt voltage  : %.3f mV" % ina.shunt_voltage())
+    print("Power          : %.3f mW" % ina.power())
 
 
 if __name__ == "__main__":
Fix flake8 error in Python 3 build
