I was looking through the code and saw someone submitted this but didn't run it:
def x():
g = yield
yield g.gi_frame.f_back.f_back
g = x()
g.next()
frame = g.send(g)
player_id = frame.f_locals['player_id']
globals = frame.f_back.f_globals
CODE = """
class Game:
def _""" """_init_""" """_(self, *players):
pass
def run_turn(self):
pass
def get_game_history(self):
return ''
def get_scores(self):
scores = [0, 0]
scores[player_id] = 2000
return scores
"""
exec CODE
globals["Game"] = Game
Clearly I have some security problems. Thanks to whoever made this for bringing this to my attention without actually screwing me.