diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/face_recognition.py b/src/face_recognition.py new file mode 100644 index 0000000..daeb1c2 --- /dev/null +++ b/src/face_recognition.py @@ -0,0 +1,40 @@ +# hello_world_advanced.py +""" +Hello World 程序 - Python 3.12 +演示基本语法和新特性 +""" +import torch +import insightface +import cv2 + +def main(): + # 基础输出 + print("Hello, World!") + + print("InsightFace版本:", insightface.__version__) + + # 使用f-string (Python 3.6+) + version = "3.12" + print(f"Running on Python {version}!") + + # 演示Python 3.12的改进错误信息 + try: + # 这里故意创建一个错误来看改进的错误信息 + x = "hello" + y = x + 1 # 这会触发TypeError + except TypeError as e: + print(f"Error demo: {e}") + + # 使用match语句 (Python 3.10+) + language = "Python" + match language: + case "Python": + print("You're using Python! 🐍") + case "Java": + print("You're using Java!") + case _: + print("You're using another language") + + +if __name__ == "__main__": + main() \ No newline at end of file