""" * Version: 0.1.0.0.0 """ import sys if __name__ == "__main__": input_md_file_path = sys.argv[1] output_md_file_path = input_md_file_path.split(".")[0] + "_sentence_separated.md" fr = open(input_md_file_path, "r") lines = fr.read() fr.close() f = open(output_md_file_path, "w") write_lines = [] for line in lines.split("\n"): for sentence in line.split("."): s = sentence.strip(".").strip(" ") if s != "": write_lines += [s + "."] f.write("\n\n".join(write_lines)) f.close() print(output_md_file_path + " created.")