活动地址:CSDN21天学习挑战赛
python setup.py install
这个命令的作用等效于先install再build
pip install xxx.zip
pip install -e .
等效于:
python setup.py develop
#!/usr/bin/env python
import turtle
aj=turtle.Pen()
y=0
aj.speed(5)
#turtle.screensize(200,800)
turtle.bgcolor("black")
#aj.shape("turtle")
def head():
aj.color("green")
aj.fd(160)
x=aj.xcor()
aj.seth(90)
aj.begin_fill()
#aj.color("green")
aj.circle(x/2,180)
aj.end_fill()
aj.penup()
aj.goto(33,37)
aj.pendown()
aj.dot(13,"black")
aj.penup()
aj.goto(126,37)
aj.pendown()
aj.dot(13,"black")
aj.penup()
aj.home()
aj.pendown()
aj.hideturtle()
aj.fd(160)
aj.seth(90)
aj.circle(x/2,60)
aj.right(90)
aj.pensize(5)
aj.fd(30)
aj.penup()
aj.home()
#aj.pendown()
aj.hideturtle()
aj.fd(160)
aj.seth(90)
aj.circle(x/2,120)
aj.right(90)
aj.pensize(5)
aj.pendown()
aj.fd(30)
aj.penup()
aj.home()
aj.penup()
def body():
aj.pensize(0)
aj.home()
aj.showturtle()
aj.goto(0,-7)
aj.pendown()
aj.begin_fill()
aj.fd(160)
aj.right(90)
aj.fd(120)
aj.right(90)
aj.fd(160)
y=aj.ycor()
aj.right(90)
aj.fd(120)
aj.end_fill()
def legs():
aj.penup()
#turtle.color("red")
aj.goto(33,-169)
aj.pendown()
aj.pensize(32)
aj.fd(43)
aj.penup()
aj.goto(130,-169)
aj.pendown()
aj.fd(43)
aj.penup()
def hands():
aj.home()
aj.pensize(30)
aj.goto(-18,-77)
aj.pendown()
aj.left(90)
aj.fd(65)
aj.penup()
aj.goto(179,-77)
aj.pendown()
aj.fd(65)
aj.penup()
aj.hideturtle
aj.fd(100)
aj.hideturtle()
aj.circle(100)
aj.circle(100,360,59)
aj.reset()
turtle.bgcolor("black")
turtle.pencolor("green")
turtle.hideturtle()
turtle.goto(-300,0)
aj.hideturtle
turtle.write("Thank you for watching....", font = ("Bodoni MT Black", 28, "bold"))
turtle.penup()
turtle.goto(-40,-170)
turtle.pendown()
turtle.pencolor("yellow")
turtle.write("Developed by 一个超会写Bug的安太狼", font = ("Palatino Linotype", 22, "bold"))
head()
body()
legs()
hands()
turtle.done()
运行效果:

新建文件setup.py
setup.py内容如下:
from setuptools import setup
setup(
name='demo',
version='0.0',
description='A simple example',
author='A Hang 626',
author_email='534232652@qq.com',
url='None',
py_modules=['main']
)
python setup.py --help-commands
Standard commands:
build build everything needed to install
build_py "build" pure Python modules (copy to build directory)
build_ext build C/C++ and Cython extensions (compile/link to build directory)
build_clib build C/C++ libraries used by Python extensions
build_scripts "build" scripts (copy and fixup #! line)
clean clean up temporary files from 'build' command
install install everything from build directory
install_lib install all Python modules (extensions and pure Python)
install_headers install C/C++ header files
install_scripts install scripts (Python or otherwise)
install_data install data files
sdist create a source distribution (tarball, zip file, etc.)
register register the distribution with the Python package index
bdist create a built (binary) distribution
bdist_dumb create a "dumb" built distribution
bdist_rpm create an RPM distribution
bdist_wininst create an executable installer for MS Windows
check perform some checks on the package
upload upload binary package to PyPI
Extra commands:
alias define a shortcut to invoke one or more commands
bdist_egg create an "egg" distribution
develop install package in 'development mode'
dist_info create a .dist-info directory
easy_install Find/get/install Python packages
egg_info create a distribution's .egg-info directory
install_egg_info Install an .egg-info directory for the package
rotate delete older distributions, keeping N newest files
saveopts save supplied options to setup.cfg or other config file
setopt set an option in setup.cfg or another config file
test run unit tests after in-place build (deprecated)
upload_docs Upload documentation to sites other than PyPi such as devpi
isort Run isort on modules registered in setuptools
bdist_wheel create a wheel distribution
compile_catalog compile message catalogs to binary MO files
extract_messages extract localizable strings from the project code
init_catalog create a new catalog based on a POT file
update_catalog update message catalogs from a POT file
flake8 Run Flake8 on modules registered in setup.py
build_sphinx Build Sphinx documentation
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help