usr bin env python def some_func1 print 033 31m print 35 some_func1 35

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
def some_func1():
print '\033[1;31m'
print "=" * 35 + "some_func1" + "=" * 35
print locals()
print "*" * 80
exec "a = 10" in locals()
print locals()
print "*" * 80
print "a == %d" % a
print '\033[1;m'
def some_func2():
print '\033[1;32m'
print "=" * 35 + "some_func2" + "=" * 35
print locals()
print "*" * 80
exec "a = 10" in globals(), locals()
print locals()
print "*" * 80
print "a == %d" % a
print '\033[1;m'
some_func1()
some_func2()