Pārlūkot izejas kodu

numbers.py: split code with and without classes

master
Dimitri Merejkowsky pirms 5 gadiem
vecāks
revīzija
e5a4f6d3e7
2 mainītis faili ar 14 papildinājumiem un 0 dzēšanām
  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 Parādīt failu


+ 14
- 0
sources/numbers/numbers_proc.py Parādīt failu

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