diff --git a/docs/appendix/01_use_cases.md b/docs/appendix/01_use_cases.md new file mode 100644 index 0000000..c117f5b --- /dev/null +++ b/docs/appendix/01_use_cases.md @@ -0,0 +1,16 @@ +# Python 用例索引 +为了方便大家索引内容,我们将我们这套教程中的相关使用用例通过索引的方式列出来了。 + +因为 MD 文件格式的局限性,我们没有办法在这里帮助大家进行一一解答和讨论,所以我们将解答和用例放到了 [WWW.OSSEZ.COM](https://www.ossez.com) 平台下 Python 分类中。 + +请访问: https://www.ossez.com/c/open-source/python/14 参与讨论,我会在这里等着大家。 + +## 索引链接 +请通过索引的链接快速参与讨论了解更多详细的内容。 + +### 语言基础 +针对语言的基础,请访问下面的的链接中的内容。 + +| 文章标题 | 简要介绍 | +|---|---| +| [Python With 关键字和语句](https://www.ossez.com/t/python-with/13387) | 针对 with 关键字的使用进行了一些解答。 | diff --git a/tests/FileWith.py b/tests/FileWith.py new file mode 100644 index 0000000..b989bb5 --- /dev/null +++ b/tests/FileWith.py @@ -0,0 +1,17 @@ +# Python script to Read file from JSON and convert to YAML +# Author - HoneyMoose (https://www.ossez.com) + +import json + +json_filename = 'resources/honeymoose_test.json' + +# Read and process JSON +with open(json_filename) as json_file: + data = json.load(json_file) + print(type(data)) + + for data_dict in data: + label_id = data_dict['label_id'] + print(str(label_id)) + +print(json_file.closed)