pytest.py
def test():
print('print test')
from setuptools import setup
setup(
name='printtest',
version='1.0',
py_modules=['printtest']
)
python setup.py bdist_wheel
.whl文件在dist目录下
$ CD ./dist
$ pip install printtest-1.0-py3-none-any.whl
demo1.py
import pytest
pytest.test()
执行结果
C:\Users\Jim\env\demo\Scripts\python.exe C:/Users/Jim/Desktop/demo.py
print test
Process finished with exit code 0