Update main.py (#15)

This commit is contained in:
LinearArray 2024-03-05 13:35:01 +05:30 committed by GitHub
parent dc31a18089
commit 3b32cb1909
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,14 +51,14 @@ def main():
if question_text != "[deleted]": if question_text != "[deleted]":
question_link = "https://reddit.com" + comment.parent().permalink question_link = "https://reddit.com" + comment.parent().permalink
markdown_file += ( markdown_file += (
f"{question_number}. [{question_text}]({question_link})\n" f"{question_number}. [{question_text}]({question_link})\n\n"
) ) # Add an extra newline after each question
question_number += 1 question_number += 1
with open("questions.md", "w", encoding="utf-8") as file: with open("questions.md", "w", encoding="utf-8") as file:
file.write(markdown_file) file.write(markdown_file)
print(f"{question_number} questions generated successfully.") print(f"{question_number - 1} questions generated successfully.")
if __name__ == "__main__": if __name__ == "__main__":