小提示库

tinyprompt的Python项目详细描述


build statusLatest Released VersionSupported Python VersionsLicense

轻触

一个很小的库,用于很好的、方便的提示,主要用于操作脚本。

本自述包含所有文档。

使用量

pip install tinyprompt

使用tinyprompt.skiptable是/skip/quit包装脚本步骤 迅速。这对于简单的脚本操作非常有用,其中 -是的是正常情况 -跳过可用于在失败或中止后恢复 -退出用于在遇到问题时中止

importtinyprompt# note: tinyprompt.skippable passes arguments through verbatim, but it's# not guaranteed to return a meaningful result# `quit` does a sys.exit(1) and `skip` makes it return `None`@tinyprompt.skippable('skippable script step')defmy_func():"""
    Do some things, this docstring will show up as a command description
    when the script is run.
    The "skippable script step" arg will be uppercased and used as the step
    name.
    """print('this skippable step')@tinyprompt.skippable('other skippable script step',color=False)defmy_func2():"""another func"""print('hi')defotherfunc():# yes, it's on purposetinyprompt.color_print('red string',tinyprompt.RED)tinyprompt.color_print('yellow string',tinyprompt.BLUE)tinyprompt.color_print('green string',tinyprompt.GRAY)tinyprompt.color_print('blue string',tinyprompt.GREEN)tinyprompt.color_print('gray  string',tinyprompt.YELLOW)defmain():my_func()# skippablemy_func2()# skippableotherfunc()# not skippable, but not reached on quitif__name__=='__main__':main()

贡献

  • 所有代码必须通过测试
  • 所有代码都用黑色isort
  • 自动格式化
  • 无论何时发现错误,请尝试编写测试
  • 把你的档案清理干净。重新定位以避免合并冲突和挤压修复提交

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java重写父类中的特定行   java Apache Commons CLI订购帮助选项?   java如何将数据添加到网格视图   java如何在Apache Camel批处理后移动文件?   java如何为日期范围的between子句编写hql查询?   雅加达ee开始Java编程,我应该从哪里开始?   排序Java8+流:检查我的objectinstances的两个字段的列表顺序是否正确   java如何将json转换为Map<String,Object>确保整数为整数   java不能在Spring数据JPA批处理过程中创建TransactionException   java损坏的PDF文件从FTP下载到使用Apache Common Net的设备   java无法使用Spring批处理和Wso2为XML架构命名空间找到Spring NamespaceHandler   java Android ImageView未显示在SherlockFragment中   Maven在构建时出错=无法识别Java路径   java如何使用批处理文件调用关闭处理程序?   java admob广告横幅重叠我的游戏屏幕安卓