python之函数用法globals()
# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#python之函数用法globals() #globals()
#说明:在当前作用域下,查看全局变量
'''
globals(...)
globals() -> dictionary Return the dictionary containing the current scope's global variables.
''' #案例
b='xiaodeng'
print globals#<built-in function globals>
print globals()
'''
{
'b': 'xiaodeng',
'__builtins__': <module '__builtin__' (built-in)>,
'__file__': 'C:\\Users\\Administrator\\Desktop\\Test\\Test.py',
'__package__': None,
'__name__': '__main__',
'__doc__': "\nglobals(...)\n globals() -> dictionary\n \n Return the dictionary containing the current scope's global variables.\n"
}
'''
python之函数用法globals()的更多相关文章
- python之函数用法execfile()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法execfile() #execfile() #说明:用来执行一个文件,相对于双击的效 ...
- Python回调函数用法实例详解
本文实例讲述了Python回调函数用法.分享给大家供大家参考.具体分析如下: 一.百度百科上对回调函数的解释: 回调函数就是一个通过函数指针调用的函数.如果你把函数的指针(地址)作为参数传递给另一个函 ...
- python之函数用法setdefault()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法setdefault() #D.get(k,d) #说明:k在D中,则返回 D[K], ...
- python之函数用法fromkeys()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法fromkeys() #fromkeys() #说明:用于创建一个新字典,以序列seq ...
- python之函数用法get()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法get() #http://www.runoob.com/python/att-dic ...
- python之函数用法capitalize()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法capitalize() #capitalize() #说明:将字符串的第一个字母变成 ...
- python之函数用法isupper()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法isupper() #http://www.runoob.com/python/att ...
- python之函数用法islower()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法islower() #http://www.runoob.com/python/att ...
- python之函数用法startswith()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法startswith() #http://www.runoob.com/python/ ...
随机推荐
- SET XACT_ABORT ON 数据库事务
转载:http://www.cnblogs.com/rob0121/articles/2320932.html SET XACT_ABORT ON SET XACT_ABORT ON分为两种: 1.总 ...
- DB2与Sybase/Oracle/Informix的比较
DB2是IBM的数据库产品,近年来Oracle.Sybase等数据库的大力发展曾使很多人认为DB2将逐步退出数据库市场,但几年过去了,DB2不但没有退出的迹象,反而一步步发展壮大,逐步夺回失去的市场. ...
- 使用 UIFontWDCustomLoader 载入自定义字体
UIFontWDCustomLoader https://github.com/daktales/UIFontWDCustomLoader You can use UIFontWDCustomLoad ...
- Ubuntu安装Oracle时出现乱码,及其他安装错误
只要在运行./runInstaller之前先运行下以下命令就ok了: export LANG=en_US #设置运行语言 编译错误 ln -s /usr/lib/i386-linux-gnu/libp ...
- ubuntu 常用配置
root 登录 sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf加:greeter-show-manual-login=true设 ...
- 通过Web启动本地应用程序
通过自定义协议在Web中启动本地应用程序 实例是打开本地安装的Word程序 注册自己的协议Windows Registry Editor Version 5.00 [HKEY_CLASSES_RO ...
- spark-submit提交作业过程
1. 作业提交方法以及参数 我们先看一下用Spark Submit提交的方法吧,下面是从官方上面摘抄的内容. # Run application locally on 8 cores ./bin/sp ...
- Android中Intent的显示和隐式使用
Android应用程序中组件之间的通信都少不了Intent的使用,Intent负责对应用中一次操作的动作.动作涉及数据.附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件, ...
- Same Tree leetcode java
题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are ...
- 《House of Cards》观后感
<House of Cards>,首先我得说好看,36个赞,比我以前看的那些美剧都要好看,虽然我是个屌丝程序员,但是我还是希望我自己看书不只看专业的书那种,虽然我是个屌丝程序员,工科男,所 ...