cool hit counter [Songqin Software Automation Testing] How to Publish Your Python Modules_Intefrankly

[Songqin Software Automation Testing] How to Publish Your Python Modules

When we learn Python, besides installing some modules with pip, sometimes we download installers down from websites to install them, I also want to make such an installer for the modules I write, what should I do and how do I publish it?

Roughly, the following four steps are required.

1. First create a folder for the module.

As a simple chestnut, you have written an module file with an add method to implement addition. This first step will require you to create a folder. and copy into this folder, which we'll just name add for simplicity's sake


2. Then create a file named "" in the new folder.

Edit this file and add the following code. This file contains metadata about the release, as in the following example, and the specific metadata can differ from the example.

3. Build a release file.

Now we have a folder containing two files: the module code in and the relevant metadata in Next we'll use Python's own publishing tool to create the publishing file.

Open a terminal in the add folder, or cmd command line cd to the add folder and execute the following command.

4. Install the release module into your local Python.

Still in the terminal you just opened, type the following command.

Look for the release message to appear on the screen to confirm that the installation was successful and the release is ready.

We end up with the following folder structure.

Of which.

- The file MANIFEST contains the list of files in the release

- Both and in the root directory are code files

- distadd-1.0.0.tar.gz is the distribution package

- add.pyc is the compiled version code

- stores metadata

1、30 years of electronic money from emoney to blockchain
2、A programmers guide to daily dislikeavi please open with caution product managers avoid it
3、AEM Racing Integrated Instrumentation
4、How does TCM Chain combine TCM with blockchain
5、Modeling Experience Early Learning

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送