Python 上传和更新函数模块到PyPI
2015-09-17 19:01
591 查看
1. update setup.py
2. update nester.py
3. install new version moudle to local
4. upload new version moudle to PyPI
5. test new moudle code
from distutils.core import setup setup( name = 'iamericnester', version = '1.4.0', py_modules = ['nester'], author = 'eric', author_email= 'eric@126.com', url = 'http://126.com', description = 'a simple nested lists,fix the bug', )
2. update nester.py
"""this is a new fuction, which work for a list""" def print_lol(the_list,indent=False,level=0): """ one arguement is the_list""" for each_item in the_list: if isinstance(each_item,list): print_lol(each_item,indent,level+1) else: if indent: for tab_stop in range(level): print("\t",end='') print(each_item)
3. install new version moudle to local
C:\Users\eric\Documents\Python\nester>c:\Users\eric\AppData\Local\Programs\Python\Python35-32\python.exe setup.py install running install running build running build_py running install_lib running install_egg_info Writing c:\Users\eric\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\iamericnester-1.4.0-py3.5.egg-info
4. upload new version moudle to PyPI
C:\Users\eric\Documents\Python\nester>c:\Users\eric\AppData\Local\Programs\Python\Python35-32\python.exe setup.py sdist upload running sdist running check warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list) warning: sdist: standard file not found: should have one of README, README.txt writing manifest file 'MANIFEST' creating iamericnester-1.4.0 making hard links in iamericnester-1.4.0... hard linking nester.py -> iamericnester-1.4.0 hard linking setup.py -> iamericnester-1.4.0 creating 'dist\iamericnester-1.4.0.zip' and adding 'iamericnester-1.4.0' to it adding 'iamericnester-1.4.0\nester.py' adding 'iamericnester-1.4.0\PKG-INFO' adding 'iamericnester-1.4.0\setup.py' removing 'iamericnester-1.4.0' (and everything under it) running upload Submitting dist\iamericnester-1.4.0.zip to https://pypi.python.org/pypi
5. test new moudle code
========== RESTART: C:\Users\eric\Documents\Python\nester\nester.py ========== >>> import nester >>> names = ['john','eric',['david','bob']] >>> nester.print_lol(names) john eric david bob >>> nester.print_lol(names,True) john eric david bob >>> nester.print_lol(names,True,3) john eric david bob >>>
相关文章推荐
- Python 共享和上传函数模块到PyPI
- ubuntu14.04 安装mod_python
- python 进程相关 (八)
- python生成一组随机数
- python
- 说说Python程序的执行过程
- django1.6 python manage.py collectstatic
- python -- why defined '__new__' and '__init__' all in a class
- python 遍历指定文件夹下的所有文件内容
- myeclipse python插件安装和环境配置(Windows7下)
- python IndentationError:
- ubuntu eclipse Python开发环境配置
- python定时任务调度库_apscheduler的使用(2)
- Flask Excel python操作excel
- python 线程相关 (七)
- Python 创建和发布安装函数模块
- Python 学习(3)---Python标准异常总结
- python 基础数据类型 (一)
- 小甲鱼Python笔记(下)
- python的soap模块扩展