# AUTOGENERATED! DO NOT EDIT! File to edit: 10_gym_environment.ipynb (unless otherwise specified).

__all__ = ['show_env']

# Cell
import os
import re

def show_env(path, output_file):
    """

    This function will show all env on the path.

    Args:
        path : gym register file path.
        output_file :　The file to store all env name.

    Return:
        env : List all env name from the path.

    """

    os.system("cat " + path + " | grep \"id=\" >> " + output_file)

    env = []
    f = open(output_file, 'r')
    for line in f.readlines():
      if(line.find('#')):
        flag = [_.start() for _ in re.finditer("\'",line)]
        env.append(line[flag[0]+1:flag[1]])
    f.close()

    return env