Bläddra i källkod

numbers.py: split code with and without classes

master
Dimitri Merejkowsky 5 år sedan
förälder
incheckning
e5a4f6d3e7
2 ändrade filer med 14 tillägg och 0 borttagningar
  1. +0
    -0
      sources/numbers/numbers_object.py
  2. +14
    -0
      sources/numbers/numbers_proc.py

sources/numbers/numbers.py → sources/numbers/numbers_object.py Visa fil


+ 14
- 0
sources/numbers/numbers_proc.py Visa fil

@@ -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()