From 24459bc94d9aada8f0924516230935177b1711db Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 11 Jul 2019 22:43:17 +0200 Subject: [PATCH] Allow multiple CLI arguments --- main/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main/main.py b/main/main.py index f657943..a53b8bd 100644 --- a/main/main.py +++ b/main/main.py @@ -152,13 +152,14 @@ class InseeData: def main(): - # insee_number = "168127982980507" - insee_number = "269059913116714" + numbers = ["269059913116714", "168127982980507"] if len(sys.argv) > 1: - insee_number = sys.argv[1] - data = InseeData(insee_number) - print(data) - pprint.pprint(data.to_dict()) + numbers = sys.argv[1:] + for number in numbers: + data = InseeData(number) + print(data) + pprint.pprint(data.to_dict()) + print('\n\n') if __name__ == '__main__':