From 3d296fdc24b940edc8780520307c35543e9b445c Mon Sep 17 00:00:00 2001 From: Hacker <72150854+Futurehacker812@users.noreply.github.com> Date: Thu, 1 Oct 2020 10:25:23 +0530 Subject: [PATCH] Update index_updater.py --- index_updater.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index_updater.py b/index_updater.py index 6f4e1bb3..af4707c4 100755 --- a/index_updater.py +++ b/index_updater.py @@ -1,7 +1,9 @@ #!/usr/bin/env python3 +#importing modules import sys import os +#all of these modules are in-built # Terminal parameters. if len(sys.argv[1:]) == 0: @@ -21,8 +23,8 @@ # If we have files, write "index.md" if curr_files: - with open(os.path.join(root, 'index.md'), mode='w') as md_file: + with open(os.path.join(root, 'index.md'), mode='w') as md_file: #opining the file in write mode md_file.write('# Index of {}\n\n'.format(curr_folder)) for line in curr_files: file_name = line.split('.')[0].replace('_',' ').title() - md_file.write('* [' + file_name + '](' +line + ')\n') + md_file.write('* [' + file_name + '](' +line + ')\n') # \n is for going to next line