Use setup.py to Install Python Program

https://docs.python.org/2/distutils/setupscript.html
https://docs.python.org/2.7/distutils/setupscript.html#installing-scripts

#Solution

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python
# encoding: utf-8


from distutils.core import setup

setup(
name='foo',
version='1.0',
description='Yarving foo program',
author='Yarving',
author_email='yarving@gmail.com',
url='https://yarving.github.io',
scripts=['scripts/ywrun.py']

)

Refer to pip(cat /usr/local/bin/pip2.7)

1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/python

# -*- coding: utf-8 -*-
import re
import sys

from pip import main

if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
0%