# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#python之函数用法vars() #vars()
#说明:返回对象object的属性和属性值的字典对象
'''
vars(...)
vars([object]) -> dictionary
dictionary:字典对象 Without arguments, equivalent to locals().
With an argument, equivalent to object.__dict__.
''' class My():
'Test'
def __init__(self,name):
self.name=name def test(self):
print self.name vars(My)#返回一个字典对象,他的功能其实和 My.__dict__ 很像 for key,value in vars(My).items():
print key,':',value
'''
test : <function test at 0x02112C70>----test函数
__module__ : __main__
__doc__ : Test
__init__ : <function __init__ at 0x01E42B70>----构造函数
'''

python之函数用法vars()的更多相关文章

  1. Python回调函数用法实例详解

    本文实例讲述了Python回调函数用法.分享给大家供大家参考.具体分析如下: 一.百度百科上对回调函数的解释: 回调函数就是一个通过函数指针调用的函数.如果你把函数的指针(地址)作为参数传递给另一个函 ...

  2. python之函数用法setdefault()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法setdefault() #D.get(k,d) #说明:k在D中,则返回 D[K], ...

  3. python之函数用法fromkeys()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法fromkeys() #fromkeys() #说明:用于创建一个新字典,以序列seq ...

  4. python之函数用法get()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法get() #http://www.runoob.com/python/att-dic ...

  5. python之函数用法capitalize()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法capitalize() #capitalize() #说明:将字符串的第一个字母变成 ...

  6. python之函数用法isupper()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法isupper() #http://www.runoob.com/python/att ...

  7. python之函数用法islower()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法islower() #http://www.runoob.com/python/att ...

  8. python之函数用法startswith()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法startswith() #http://www.runoob.com/python/ ...

  9. python之函数用法endswith()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法endswith() #http://www.runoob.com/python/at ...

随机推荐

  1. Hello World on Impala

    Cloudera Impala 官方教程 <Impala Tutorial>,解说了Impala一些基本操作,但操作步骤前后缺少连贯性,本文节W选<Impala Tutorial&g ...

  2. 读 Zepto 源码系列

    虽然最近工作中没有怎么用 zepto ,但是据说 zepto 的源码比较简单,而且网上的资料也比较多,所以我就挑了 zepto 下手,希望能为以后阅读其他框架的源码打下基础吧. 源码版本 本文阅读的源 ...

  3. 【docker】centOS7上部署的mysql和spring boot服务,要求,mysql的时间、java程序服务的时间和宿主机的时间完全保持一致【修改mysql时区,临时和永久】【修改spring boot配置文件时区】【修改docker启动spring boot实例程序时区】

    要求:centOS7上部署的mysql和spring boot服务,要求,mysql的时间.java程序服务的时间和宿主机的时间完全保持一致: ============================ ...

  4. cron表达式举例

    1.quartz定时任务时间设置描述(2011-03-03 16:23:50)转载▼标签: quartz时间it 分类: 凌乱小记 这些星号由左到右按顺序代表 : * * * * * * * 格式: ...

  5. TOMCAT6热部署配置

    在J2EE开发过程中,经常需要在启动tomcat后修改java类文件,tomcat默认会自动加载修改的类,但这只是重新启动整个项目换句话说就是自动帮我们重启tomcat,这样就浪费了大量的时间在等等t ...

  6. (a*b)%c 小的技巧

    (a*b)%c这个问题看上去好简单啊. 当然我们不是来说这么简单的问题了.你想一想,我们会不会遇到这种情况,a是__int64 ,b也是__int64 当两个数足够大的时候我们直接相乘的就会出现__i ...

  7. IIS HTTPS 禁用不安全的SSL2.0

    禁用: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\Protocols 验证:

  8. Mysql运行模式及1690错误处理

    最近一段运行良好的代码突然无法运行,报错: MySQL said: Documentation 1690 - BIGINT UNSIGNED value is out of range in 经过查询 ...

  9. 从win10家庭版/中文版升级到win10专业版

    发布时间:2015-8-4     很多同学在不了解win10系统版本的情况下,安装了win10家庭版/中文版,不管是win10家庭版,还是win10家庭中文版,或者是win10家庭单语言版,它们都是 ...

  10. Java输入输出处理技术2

    7.从键盘输入 从键盘输入一行字符,并显示到屏幕上. package io; import java.io.*; public class ReadAndWrite { public static v ...