diff --git a/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py b/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py index 6866980..d57b12e 100644 --- a/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py +++ b/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py @@ -13,7 +13,7 @@ extension = ".py" domain = "Python" -author = "Ahmedur Rahman Shovon" +author = "Sohayel Mahmud" created_date = datetime.datetime.today().strftime("%d %B %Y") info_file_name = "python_info.txt" @@ -43,7 +43,7 @@ def write_file_header(title, subdomain): line = line.strip() if line == "": continue - elif line[0] == "[": + elif line.startswith("["): problem_list = line else: subdomain_name = line @@ -57,10 +57,10 @@ def write_file_header(title, subdomain): for title in title_ar: file_header_str = write_file_header(title[1:-1], subdomain_name) title_valid = valid_name(title) - f = open(folder_name + "\\" + title_valid + extension, "w") + f = open(os.path.join(folder_name, title_valid + extension), "w") f.write(file_header_str) f.close() print("Folder: " + str(folder_name) + ". Total files: " + str(title_ar_len)) subdomain_name = "" - problem_list = "" + problem_list = "" \ No newline at end of file