import os
import sys

dir_path_csv=sys.argv[1]

def get_file_names(directory):
    results=[]
    # Iterate directory
    for file_path in os.listdir(directory):
        # check if current file_path is a file
        if os.path.isfile(os.path.join(directory, file_path)):
            # add filename to list
            results.append(directory+file_path)
    return results

csv = get_file_names(dir_path_csv)
for file_csv in csv:
    if file_csv.endswith(".csv"):
        command = "python3 generate_models.py"
        command += " -dataset=" + file_csv
        print(command)
        os.system(command)
        #input("Press Enter to continue...")