步骤一:创建包

Python——制作模块

步骤二:编辑示例模块代码

Python——制作模块

Python——制作模块

__init__调用:

Python——制作模块

步骤三:创建setup.py

 Python——制作模块

from distutils.core import setup

setup(name="package_name",  # 包名
      version="1.0",  # 版本
      description="description",  # 描述信息
      long_description="Full description",  # 完整描述信息
      author="author",  # 作者
      author_email="1425868653@qq.com",  # 作者邮箱
      url="https://www.cnblogs.com/Jery-9527/",  # 主页
      py_modules=["function1", "function2"])

步骤四:cmd窗口用setup.py文件构建模块

Python——制作模块

步骤五:生成发布压缩包

Python——制作模块

结果:

 Python——制作模块

Python——制作模块

 

 大功告成!

 

相关文章:

  • 2022-01-08
  • 2021-11-10
  • 2022-01-06
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2021-09-20
猜你喜欢
  • 2022-01-22
  • 2021-06-14
  • 2022-12-23
  • 2021-10-24
  • 2021-11-23
  • 2021-12-17
  • 2022-12-23
相关资源
相似解决方案