gym library python code example
Example 1: how to install openai gym in ubuntu
sudo -H pip3 install gym #for minimum
sudo -H pip3 install gym[all] #for full
Example 2: openai gym random action
# load gym envirolment
import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(300):
env.render()
env.step(env.action_space.sample()) # take a random action
env.close()