locals() Is Read-Only: globals() Is Not,read-onlyglobals,def foo(arg)
locals() Is Read-Only: globals() Is Not,read-onlyglobals,def foo(arg)
def foo(arg): x = 1 print locals() locals()['x'] = 2 print 'x=',x z = 7 print 'z=',z foo(3) globals()['z'] = 8 print 'z=',z
- Displaying location, type and value for a sum,displayi
- And Or in Python: int, empty list and empty dictionary,
- Packages Are Modules,packagesmodules,from xml.dom
- string to list,stringlist,print str([1
- Re-raise the exception,re-raiseexception,try: rai
- Random string value,randomstringvalue,import rando
热门文章:
相关内容
- Displaying location, type and value for a sum,displayinglocation,in
- And Or in Python: int, empty list and empty dictionary,pythonempty,
- Packages Are Modules,packagesmodules,from xml.dom
- string to list,stringlist,print str([1
- Re-raise the exception,re-raiseexception,try: rai
- Random string value,randomstringvalue,import rando
- Uses simple shared global data to know when threads are done in paren
- Encode file: latin,encodefilelatin,import sys,
- Massive identifier substitution on C source files,,'''PYTHON SO
- The use of quotes in strings,quotesstrings,print 'Progr
评论关闭