From e5a4f6d3e7539f5296ff7bf14e45279669e71911 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Sat, 16 Feb 2019 17:07:41 +0100 Subject: [PATCH] numbers.py: split code with and without classes --- sources/numbers/{numbers.py => numbers_object.py} | 0 sources/numbers/numbers_proc.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+) rename sources/numbers/{numbers.py => numbers_object.py} (100%) create mode 100644 sources/numbers/numbers_proc.py diff --git a/sources/numbers/numbers.py b/sources/numbers/numbers_object.py similarity index 100% rename from sources/numbers/numbers.py rename to sources/numbers/numbers_object.py diff --git a/sources/numbers/numbers_proc.py b/sources/numbers/numbers_proc.py new file mode 100644 index 0000000..e236a1b --- /dev/null +++ b/sources/numbers/numbers_proc.py @@ -0,0 +1,14 @@ +import sys +import urllib.request + + +def main(): + number = sys.argv[1] + with urllib.request.urlopen("http://numbersapi.com/" + number) as request: + response = request.read().decode("utf-8") + print(response) + + +if __name__ == "__main__": + main() +