python(二)

一:

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(函数名)察看帮助。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值