问:如何输入命令行就能执行python代码呢?

答:要将python模块转变为命令行工具只用在 setup.py 文件中添加参数entry_points

例如:

entry_points={
'console_scripts': [
'pycase = pycase.case:main'
]
}

pycase 是自定义的参数,往后看

setup.py完整设置:

# -*- coding: utf-8 -*-

from setuptools import setup, find_packages

"""
打包的用的setup必须引入,
"""

VERSION = '0.0.1'

setup(name='pycase',
        version=VERSION,
        description="a command line tool for camel case",
        long_description='a python command tool for camel case',
        classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
        keywords='pycase',
        author='Peng',
        author_email='peng@gmail.com',
        license='MIT',
        packages=find_packages(),
        include_package_data=True,
        zip_safe=True,
        install_requires=[],
        entry_points={
             'console_scripts': ['pycase = pycase.case:main']
        }
)

最新文章

  1. Azure HDInsight 和 Spark 大数据实战(二)
  2. python test
  3. win10下iis部署asp.net core rtm
  4. ORACLE函数大全
  5. linux 安装 php
  6. OLEDB 连接EXCEL的连接字符串IMEX的问题(Oledb)
  7. prevPage / nextPage in jQuery Mobile | George Nixon's Blog
  8. ural 1353. Milliard Vasya's Function(背包/递归深搜)
  9. [USACO08JAN]haybale猜测Haybale Guessing
  10. P1579哥德巴赫猜想
  11. WPS生成文章目录
  12. VS2008 快捷键大全
  13. rpc和http
  14. mysql字符串 转 int-double CAST与CONVERT 函数的用法
  15. react路由嵌套
  16. SRM476
  17. http 断点续传
  18. jupyter(ipython notebook) 安装和入门教程
  19. MacOS 如何截屏
  20. 查看cpu 个数, 内存信息

热门文章

  1. K8S集群入门:运行一个应用程序究竟需要多少集群?
  2. codewars--js--Reverse or rotate?----es6变量,箭头函数,正则取块
  3. html语义化的意义
  4. iis添加asp.net网站,访问提示:由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射
  5. 戏说前端之CSS编码规范
  6. Android EditText不可编辑单行显示能滑动查看内容
  7. js Dom为页面中的元素绑定键盘或鼠标事件
  8. 【转】为什么使用length获取Java数组的长度
  9. Centos 安装 Go 编译环境
  10. GHO文件安装到Vmware的两种姿势