From 7698db24ced17ad203248b4c4e729c1ce4873686 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 20 Aug 2019 15:12:36 +0530 Subject: [PATCH] Also print total vm count + make result clearer --- ungleich_pay.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ungleich_pay.py b/ungleich_pay.py index c236396..9705640 100644 --- a/ungleich_pay.py +++ b/ungleich_pay.py @@ -59,8 +59,14 @@ class ungleichPay(object): if (response_json['response'] == 'success'): data = response_json["data"] rows = [(x['email'], x['vm_count']) for x in data] - headers = ["email", "vm_count"] + headers = ["customer", "vm_count"] + print("---") print(tabulate(rows, headers)) + print("---") + vm_count = 0 + for x in data: + vm_count += x['vm_count'] + print("Total vm_count = {}".format(vm_count)) else: print("An error occurred.") print(response_json["message"])