将Python模块转变为命令行工具
问:如何输入命令行就能执行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']
}
)
最新文章
- Azure HDInsight 和 Spark 大数据实战(二)
- python test
- win10下iis部署asp.net core rtm
- ORACLE函数大全
- linux 安装 php
- OLEDB 连接EXCEL的连接字符串IMEX的问题(Oledb)
- prevPage / nextPage in jQuery Mobile | George Nixon's Blog
- ural 1353. Milliard Vasya's Function(背包/递归深搜)
- [USACO08JAN]haybale猜测Haybale Guessing
- P1579哥德巴赫猜想
- WPS生成文章目录
- VS2008 快捷键大全
- rpc和http
- mysql字符串 转 int-double CAST与CONVERT 函数的用法
- react路由嵌套
- SRM476
- http 断点续传
- jupyter(ipython notebook) 安装和入门教程
- MacOS 如何截屏
- 查看cpu 个数, 内存信息
热门文章
- K8S集群入门:运行一个应用程序究竟需要多少集群?
- codewars--js--Reverse or rotate?----es6变量,箭头函数,正则取块
- html语义化的意义
- iis添加asp.net网站,访问提示:由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射
- 戏说前端之CSS编码规范
- Android EditText不可编辑单行显示能滑动查看内容
- js Dom为页面中的元素绑定键盘或鼠标事件
- 【转】为什么使用length获取Java数组的长度
- Centos 安装 Go 编译环境
- GHO文件安装到Vmware的两种姿势