From 5c9ffb4c9dd6b0d92d6aaf0d2cd1047611d3d6cc Mon Sep 17 00:00:00 2001 From: pbgco2nhq <1625354389@qq.com> Date: Sat, 27 Apr 2024 22:46:38 +0800 Subject: [PATCH] Update README.md --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5503356..95fffee 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ -# pythonfire +##介绍 +这个项目是我们小zu学习 Python Fire 的学习报告。Python Fire 是一个开源库,它可以通过单个函数、对象调用生成命令行界面(CLI),无需编写大量的代码。在这个学习报告中,我们将分享对 Python Fire和git的学习心得和使用经验。 +##安装: +可打开命令行用pip工具安装 +`pip install fire` +##使用方法 +示例: +```import fire +def hello(name="World"): + return f"Hello, {name}!" + +if __name__ == "__main__": + fire.Fire(hello) +``` +通过运行以上代码,你可以在命令行中输入 python test.py hello --name="Alice" 来执行 hello 函数并传递参数。 +##总结 +Python Fire 是一个非常强大和灵活的工具,可以帮助你快速创建命令行界面。 \ No newline at end of file