渐进式创建python脚本
progressive_script的Python项目详细描述
progressive script develop help module.
渐进式脚本开发辅助模块。
在python的一些日常脚本任务开发中,一种模式一遍又一遍出现,那就是一边notebook上实时测试,一边进一步决定下面的行为。同时我们又希望之前的动作在脚本中就不要再执行了,而之前动作中出现的某些数据,我们希望保留下来,供后面的流程使用,或者某些动作我们希望单独提出来,再刷一遍。
这有点类似于jupyter notebook上的测试和最终开发运行脚本,在某种程度上保持着某种风格上的一致性。
本着这点决定开发这个模块。
— 简介 — progressive_script 会针对目标脚本维护一个目标脚本文件名相同的pkl数据文件。
— 使用 — 请参见 tests 文件夹下的 test_progress_script.py 文件。
- ::
python test_script.py –help 查看总帮助 可以看还有额外的那些子任务
python test_script.py # 默认运行主流程
python test_script.py sub-task –help # 查看子任务帮助
python test_script.py sub-task # 单独运行某个子任务【会自动加载data】
python test_script.py set-step # show current step
python test_script.py set-step 3 # 设置step
python test_script.py show-data <key> # 显示维护的data的某个key的值
python test_script.py set-data <key> <value> # 设置维护的data的某个key的值
python test_script.py show-tasks # 显示当前脚本定义的工作流