From 85537a33185b51985d4b0ce28028954d882c7f10 Mon Sep 17 00:00:00 2001 From: wulb wu <133581333+WuuLibin@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:25:08 +0000 Subject: [PATCH 1/7] Update index.html to print hello world --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 7bee67b55..8362b0216 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,7 +7,7 @@

- GitHub Codespaces ♥️ Flask + GitHub Codespaces ♥️hello Flask

Edit templates/index.html and refresh to see your changes! From e8417f85e5b3bc87d48caa4c79cfad5e43bc7d97 Mon Sep 17 00:00:00 2001 From: wulb wu <133581333+WuuLibin@users.noreply.github.com> Date: Tue, 11 Feb 2025 11:15:28 +0000 Subject: [PATCH 2/7] hello wulb --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 8362b0216..91458ae75 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,7 +7,7 @@

- GitHub Codespaces ♥️hello Flask + GitHub Codespaces ♥️hello wulb Flask

Edit templates/index.html and refresh to see your changes! From 2e3a6c472ed2a8c0047258ea8b2091b6358590a1 Mon Sep 17 00:00:00 2001 From: wulb wu <133581333+WuuLibin@users.noreply.github.com> Date: Tue, 11 Feb 2025 11:40:44 +0000 Subject: [PATCH 3/7] add app2.py and dict.py --- dict.py | 43 +++++++++++++++++++++++++++++++++++++++++++ templates/app2.py | 12 ++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 dict.py create mode 100644 templates/app2.py diff --git a/dict.py b/dict.py new file mode 100644 index 000000000..475348769 --- /dev/null +++ b/dict.py @@ -0,0 +1,43 @@ +# 创建一个空字典 +fruits = {} + +# 创建一个包含一些水果及其数量的字典 +fruits = { + 'apple': 10, + 'banana': 5, + 'orange': 8 +} +# 访问字典中的值 +print(fruits['apple']) # 输出: 10 +# 添加一个新的键值对 +fruits['mango'] = 15 + +# 更新一个已有的键值对 +fruits['banana'] = 7 + +print(fruits) +# 输出: {'apple': 10, 'banana': 7, 'orange': 8, 'mango': 15} +# 删除一个键值对 +del fruits['orange'] + +print(fruits) +# 输出: {'apple': 10, 'banana': 7, 'mango': 15} + +# 遍历字典中的键值对 +for fruit, quantity in fruits.items(): + print(f"The quantity of {fruit} is {quantity}") + +# 检查键是否在字典中 +if 'apple' in fruits: + print("Apple is in the dictionary") + +if 'grape' not in fruits: + print("Grape is not in the dictionary") + +# 获取所有的键 +keys = fruits.keys() +print(keys) # 输出: dict_keys(['apple', 'banana', 'mango']) + +# 获取所有的值 +values = fruits.values() +print(values) # 输出: dict_values([10, 7, 15]) \ No newline at end of file diff --git a/templates/app2.py b/templates/app2.py new file mode 100644 index 000000000..289dd7c0c --- /dev/null +++ b/templates/app2.py @@ -0,0 +1,12 @@ +from flask import Flask, jsonify +import random + +app = Flask(__name__) + +@app.route('/random', methods=['GET']) +def random_number(): + number = random.randint(1, 100) + return jsonify({'random_number': number}) + +if __name__ == '__main__': + app.run(debug=True) From 50aa08338bd4d3c9941ea0d5cc3953ed2c33091f Mon Sep 17 00:00:00 2001 From: wulb wu <133581333+WuuLibin@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:20:05 +0000 Subject: [PATCH 4/7] add students.json --- templates/app2.py => app2.py | 0 students.json | 18 +++++++++++++++++ students.py | 39 ++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) rename templates/app2.py => app2.py (100%) create mode 100644 students.json create mode 100644 students.py diff --git a/templates/app2.py b/app2.py similarity index 100% rename from templates/app2.py rename to app2.py diff --git a/students.json b/students.json new file mode 100644 index 000000000..67995e031 --- /dev/null +++ b/students.json @@ -0,0 +1,18 @@ +[ + { + "name": "Alice", + "age": 23, + "courses": [ + "Math", + "Science" + ] + }, + { + "name": "Charlie", + "age": 24, + "courses": [ + "Art", + "Design" + ] + } +] \ No newline at end of file diff --git a/students.py b/students.py new file mode 100644 index 000000000..87775b9f7 --- /dev/null +++ b/students.py @@ -0,0 +1,39 @@ +import json + +# 读取 JSON 文件 +with open('students.json', 'r') as file: + students = json.load(file) + +print(students) + +# 遍历学生列表 +for student in students: + name = student['name'] + courses = student['courses'] + print(f"Student: {name}") + print("Courses:") + for course in courses: + print(f" - {course}") + +# 添加新学生 +new_student = { + "name": "Charlie", + "age": 24, + "courses": ["Art", "Design"] +} +students.append(new_student) + +# 将更新后的数据写回到 JSON 文件 +with open('students.json', 'w') as file: + json.dump(students, file, indent=4) + +print("New student added.") + +# 删除名为 "Bob" 的学生 +students = [student for student in students if student['name'] != 'Bob'] + +# 将更新后的数据写回到 JSON 文件 +with open('students.json', 'w') as file: + json.dump(students, file, indent=4) + +print("Student 'Bob' deleted.") \ No newline at end of file From 5132ce3c77faa5965a26282970516f2b290fb475 Mon Sep 17 00:00:00 2001 From: sallem200 Date: Wed, 9 Sep 2026 20:45:55 +0200 Subject: [PATCH 5/7] Add .idea files and settings template Add IntelliJ/IDEA project files under .idea (project settings, modules, vcs, codespaces iml, appInsights and a large deviceStreaming cache) and a .idea/.gitignore. Add a new templates/settings.html and update .gitignore to ignore *.md; README.md was also modified. These changes introduce IDE configuration and a settings template to the repo. --- .idea/.gitignore | 3 + .idea/appInsightsSettings.xml | 6 + .idea/caches/deviceStreaming.xml | 1258 ++++++++++++++++++++++++++++++ .idea/codespaces-flask.iml | 9 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + templates/settings.html | 30 + 8 files changed, 1326 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/appInsightsSettings.xml create mode 100644 .idea/caches/deviceStreaming.xml create mode 100644 .idea/codespaces-flask.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 templates/settings.html diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..26d33521a --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml new file mode 100644 index 000000000..23b2e1fe4 --- /dev/null +++ b/.idea/appInsightsSettings.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml new file mode 100644 index 000000000..51d2b6186 --- /dev/null +++ b/.idea/caches/deviceStreaming.xml @@ -0,0 +1,1258 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codespaces-flask.iml b/.idea/codespaces-flask.iml new file mode 100644 index 000000000..d6ebd4805 --- /dev/null +++ b/.idea/codespaces-flask.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..1945ce5fd --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..6530c310a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/templates/settings.html b/templates/settings.html new file mode 100644 index 000000000..d0d3e02cf --- /dev/null +++ b/templates/settings.html @@ -0,0 +1,30 @@ + + + + API Settings + + + +

+
+

API Settings

+
+
+ + +
+
+ + +
+
+ + +
+ +
+

Back to Home

+
+
+ + From b05f643e2afecb9ae04f4f00574218db672d6930 Mon Sep 17 00:00:00 2001 From: sallem200 Date: Wed, 9 Sep 2026 22:26:23 +0200 Subject: [PATCH 6/7] Update README.md --- README.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/README.md b/README.md index 31d8ab9c1..dc237f22f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1 @@ -# GitHub Codespaces ♥️ Flask - -Welcome to your shiny new Codespace running Flask! We've got everything fired up and running for you to explore Flask. - -You've got a blank canvas to work on from a git perspective as well. There's a single initial commit with the what you're seeing right now - where you go from here is up to you! - -Everything you do here is contained within this one codespace. There is no repository on GitHub yet. If and when you’re ready you can click "Publish Branch" and we’ll create your repository and push up your project. If you were just exploring then and have no further need for this code then you can simply delete your codespace and it's gone forever. - -To run this application: - -``` -flask --debug run -``` +sk-e2512e9451a2423b9e524f9e05f24b44 \ No newline at end of file From a6e6b6d44aafc0c9b66214b734b7f0588bbc6fda Mon Sep 17 00:00:00 2001 From: sallem200 Date: Wed, 9 Sep 2026 22:44:40 +0200 Subject: [PATCH 7/7] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Data type: XML configuration describing Android device emulators • Contains data on 3 devices: ◦ Sony Xperia 10 (API 34, 1080x2520 screen) ◦ DOCOMO F-01L (API 27, 720x1280 screen) ◦ OnePlus (API 34, code OP535DL1) • Editor interface: supports the choice of indent size (2 spaces) and line break mode --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc237f22f..8b1378917 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -sk-e2512e9451a2423b9e524f9e05f24b44 \ No newline at end of file +