Python: how to public a model

1, Create a folder fileFolder

2, create a file tester.py

3, create another file setup.py:

The content of setup.py

  from distutils.core import setup

  setup(name = 'tester',
      version = '1.0.0',
      py_modules = ['tester'],
      author = 'MengliChen',
      author_email = 'v-mench@outlook.com',
      url = 'http://www.baidu.com',
      description = ' A simple prnter of string lists'
      )

4, public the file test.py: In the command type in python setup.py sdit

5, Install the build in your local VM: In the command type in python setup.py install

You can use the method in test.py by following code:

import tester

tester.methodName()

I work for software testing.
原文地址:https://www.cnblogs.com/vision668/p/4989012.html