浏览代码

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