python 打包和发布模块

在根目录创建setup.py文件,并写入基本信息

from distutils.core import setup

setup(
    name="tps",
    version="0.0.1",
    description="two pages spider",
    author="claroja",
    author_email="[email protected]",
    py_modules=['tps', 'jt']
)

在根目录,运行以下代码,会生成sdist文件,里面就是创建好的模块

python setup.py sdist

在根目录,运行一下代码,上传到pypi

twine upload dist/mod_name

参考:
https://www.cnblogs.com/sting2me/p/6550897.html

猜你喜欢

转载自blog.csdn.net/claroja/article/details/79972741