一:
python的文件组织结构(发布):
例如我们发布一个名为nester2.py的文件,在发布完成后,在nester2文件夹中会有如下几个项目
build文件夹 dist文件夹 MANIFEST nester2.py setup.py文件
下面对这个几个文件做一下介绍
build文件是在python setup.py install命令执行完成后创建的,如果没有build文件会创建不成功,import会失败。
dist 是在python setup.py sdist命令执行完成之后创建的,里边包括nester2.tart.gz
setup.py文件用来描述元数据,如作者版本信息等等
MANIFEST由distutils创建,不要自行修改。
那么distutils是什么呢
现在,我们暂时察看官方文档http://docs.python.org/2/distutils/
二:python标准库
Python’s standard library is very extensive, offering a wide range of facilities as indicated by the long table of contents listed below. The library contains built-in modules (written in C) that provide access to system functionality such as file I/O that would otherwise be inaccessible to Python programmers, as well as modules written in Python that provide standardized solutions for many problems that occur in everyday programming. Some of these modules are explicitly designed to encourage and enhance the portability of Python programs by abstracting away platform-specifics into platform-neutral APIs.
大体意思就是标准库提供了很多便利的工具,标准库分为两部分,一个是内置BIF,这些主要是用C语言写的,这样有助于实现系统功能。还有一个是用Python写的,这个主要是提供日常编程一些标准的需要。
关于标准库,后边我们拿出专门时间来看。当然,主要是我自己看哈。
三:
自己写了一个打印python路径的程序,显摆显摆。
import sys
def print_sys_path():
list_path=sys.path
for m in list_path:
print(m)
今天就写到这吧。
四:
我们可以使用help(函数名)察看帮助。