def get_generator(pid):
"""
Gets a handle on a problem generator module.
Args:
pid: the problem pid
Returns:
The loaded module
"""
generator_path = get_generator_path(pid)
if not path.isfile(generator_path):
raise InternalException("Could not find {}.".format(generator_path))
return imp.load_source(generator_path[:-3], generator_path)
评论列表
文章目录