python命令行应用程序裸体模板。

autocode的Python项目详细描述


这是python命令行应用程序的结构模板 通过setuptools/pypi/pip为python 2和3发布和分发。

请看一下相应的文章: http://gehrcke.de/2014/02/distributing-a-python-command-line-application/

用法

克隆此存储库并为您自己的项目采用引导结构。 这只是一个起点,但我希望是一个好的起点。从那以后,你应该 阅读并跟随http://python-packaging-user-guide.readthedocs.org/en/latest/, python打包的明确资源。

行为

灵活调用< EH3>

应用程序可以在两个不同的源目录中运行 方式:

  1. 将bootstrap目录视为包,并将视为主脚本:

    $ python -m bootstrap arg1 arg2
    Executing bootstrap version 0.2.0.
    List of argument strings: ['arg1', 'arg2']
    Stuff and Boo():
    <class 'bootstrap.stuff.Stuff'>
    <bootstrap.bootstrap.Boo object at 0x7f43d9f65a90>
    
  2. 使用bootstrap-runner.py包装器:

    $ ./bootstrap-runner.py arg1 arg2
    Executing bootstrap version 0.2.0.
    List of argument strings: ['arg1', 'arg2']
    Stuff and Boo():
    <class 'bootstrap.stuff.Stuff'>
    <bootstrap.bootstrap.Boo object at 0x7f149554ead0>
    

安装设置引导命令

安装前情况:

$ bootstrap
bash: bootstrap: command not found

从源树(或通过pypi中的pip)直接安装:

$ python setup.py install

现在,bootstrap命令可用:

$ bootstrap arg1 arg2
Executing bootstrap version 0.2.0.
List of argument strings: ['arg1', 'arg2']
Stuff and Boo():
<class 'bootstrap.stuff.Stuff'>
<bootstrap.bootstrap.Boo object at 0x7f366749a190>

在类unix系统上,安装程序将bootstrap脚本放入 集中的bin目录,应该在PATH中。在Windows上, bootstrap.exe被放在一个集中的Scripts目录中 也应该在您的PATH中。

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

推荐PyPI第三方库


热门话题
java如何制作图形来制作图表和材料设计   捕获java时的异常处理。lang.ArrayIndexOutOfBoundsException   java给定正则表达式匹配的布尔变量值的结果应该是什么?   java试图运行GUI应用程序,但GUI从未出现   java在使用Angular JS的Spring Security登录过程后缺少CSFR_令牌会话属性   键盘Java键捕捉器   java我有一个Jtextarea,它的某些部分用荧光笔突出显示。我使用Jtextarea。油漆()   jakarta ee使用Java反射从对象列表中查找参数之和   java自动将文件上传到站点,无需浏览器焦点   java JXTreeTable:保留一组高亮显示的行   jpa中的java过滤器子实体   java使用jsoup解析html表   java致命异常:主进程:com。授权。希洛,PID:28143 io。reactivex。例外情况。CompositeException:发生了2个异常。?   java如何让Android应用程序在API级别7和8上运行?