码迷,mamicode.com
首页 > 编程语言 > 详细

Head Frist Python 读书笔记 构建发布

时间:2015-11-14 16:39:54      阅读:315      评论:0      收藏:0      [点我收藏+]

标签:

构建发布 p41

Windows系统需要使用“c:\pythonX\python.exe”执行,

或者,通过配置环境变量来简化输入

1. 首先需要在系统中注册python环境变量:假设python的安装路径为c:\python2.6,则修改我的电脑->属性->高级->环境变量->系统变量中的PATH为:

(为了在命令行模式下运行Python命令,需要将python.exe所在的目录附加到PATH这个环境变量中。)

PATH=PATH;c:\python26

上述环境变量设置成功之后,就可以在命令行直接使用python命令。或执行"python *.py"运行python脚本了。

 

2. 此时,还是只能通过"python *.py"运行python脚本,若希望直接运行*.py,只需再修改另一个环境变量PATHEXT:

PATHEXT=PATHEXT;.PY;.PYM

 

技术分享

 

命令说明:

python setup.py sdist

(assuming you haven’t specified any sdist options in the setup script or config file), sdist creates the archive of the default format for the current platform. The default format is a gzip’ed tar file (.tar.gz) on Unix, and ZIP file on Windows.

You can specify as many formats as you like using the --formats option, for example:

python setup.py sdist --formats=gztar,zip

to create a gzipped tarball and a zip file. The available formats are:

FormatDescriptionNotes
zip zip file (.zip) (1),(3)
gztar gzip’ed tar file (.tar.gz) (2)
bztar bzip2’ed tar file (.tar.bz2)  
ztar compressed tar file (.tar.Z) (4)
tar tar file (.tar)  

Notes:

  1. default on Windows
  2. default on Unix
  3. requires either external zip utility or zipfile module (part of the standard Python library since Python 1.6)
  4. requires the compress program. Notice that this format is now pending for deprecation and will be removed in the future versions of Python.

When using any tar format (gztarbztarztar or tar), under Unix you can specify the owner and group names that will be set for each member of the archive.

For example, if you want all files of the archive to be owned by root:

python setup.py sdist --owner=root --group=root

 

 

tips:“打开一个终端窗口”,可以通过命令行cd到代码所在目录,也可以在所在目录shift+鼠标右键,调出命令窗口

 

Head Frist Python 读书笔记 构建发布

标签:

原文地址:http://www.cnblogs.com/lvjianwei/p/4964529.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!