def exec_module(module, global_variables):
'''Executes the provided module as if it were provided as '-m module'. The
functionality is implemented using `runpy.run_module`, which was added in
Python 2.5.
'''
import runpy
runpy.run_module(module, global_variables, run_name=global_variables.get('__name__'), alter_sys=True)
评论列表
文章目录