circuitpython/tests/basics/exec1.py
2014-02-13 00:36:54 +02:00

7 lines
107 B
Python

print(exec("def foo(): return 42"))
print(foo())
d = {}
exec("def bar(): return 84", d)
print(d["bar"]())