CartPole 倒立摆
import gym # CartPole 倒立摆 env = gym.make('CartPole-v1', render_mode="human") for episode in range(10): env.reset() print("Episode finished after {} timesteps".format(episode)) for _ in range(100): env.render() env.step(env.action_space.sample()) env.close()