diff --git a/bashplotlib/histogram.py b/bashplotlib/histogram.py index 6d16e35..bfff5b1 100644 --- a/bashplotlib/histogram.py +++ b/bashplotlib/histogram.py @@ -35,7 +35,7 @@ def read_numbers(numbers): """ Read the input data in the most optimal way """ - if isinstance(numbers, list): + if isiterable(numbers): for number in numbers: yield float(str(number).strip()) else: diff --git a/bashplotlib/utils/helpers.py b/bashplotlib/utils/helpers.py index 8ab2c3f..bfffe46 100644 --- a/bashplotlib/utils/helpers.py +++ b/bashplotlib/utils/helpers.py @@ -7,6 +7,8 @@ import sys +isiterable = lambda x: hasattr(x, '__iter__') or hasattr(x, '__getitem__') + bcolours = { "white": '\033[97m', "aqua": '\033[96m',