瀏覽代碼

numbers.py: split code with and without classes

master
Dimitri Merejkowsky 5 年之前
父節點
當前提交
e5a4f6d3e7
共有 2 個檔案被更改,包括 14 行新增0 行删除
  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 查看文件


+ 14
- 0
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()