#怎样学习一个新的模块呢


#1.dir
'''
print [n for n in dir(copy) if not n.startswith('_')]
pp (dir(copy))
'''
#2.copy.__all__的意义,不是必须有的
#告诉import copy导入所有方法的时候,到底是导入哪些方法呢
'''
print copy.__all__
#__all__ = ["Error", "copy", "deepcopy"]

import urllib
print urllib.__all__
#['urlopen', 'URLopener', 'FancyURLopener', 'urlretrieve', 'urlcleanup', 'quote', 'quote_plus', 'unquote', 'unquote_plus', 'urlencode', 'url2pathname', 'pathname2url', 'splittag', 'localhost', 'thishost', 'ftperrors', 'basejoin', 'unwrap', 'splittype', 'splithost', 'splituser', 'splitpasswd', 'splitport', 'splitnport',
# 'splitquery', 'splitattr', 'splitvalue', 'getproxies']
'''
#3.help用法
'''
help(copy.copy)
'''
#4.__doc__用法
'''
print copy.copy.__doc__
'''
#5 查看源代码__file__
'''
print copy.__file__
#C:\Python27\lib\copy.pyc
'''

转载于:https://www.cnblogs.com/xueli/p/8515344.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值