import os import sys if __name__ == "__main__": prefix = sys.argv[1] section = sys.argv[2] index_file = """ """ index_file += f"Section {section} index" index_file += f"""

Section {section} index

"""

    for f in os.listdir():
        if f == 'INDEX':
            continue
        index_file += f"{f}\n"

    index_file += "
" print(index_file)