2018年3月28日

python标准库-builtin 模块之compile,execfile

摘要: eval 函数仅仅允许执行简单的表达式。对于更大的代码块时,使用 compile 和 exec 函数。 例子:使用 compile函数验证语法 NAME = "script.py" BODY = """ prnt 'owl stretching time' """ try: compile(BODY 阅读全文

posted @ 2018-03-28 10:11 go2coding 阅读(174) 评论(0) 推荐(0) 编辑

导航