Files
grosse_haufen/convert_json_to_txt.py
2025-12-29 17:56:17 +01:00

24 lines
304 B
Python

import json
with open("thread_posts.json") as f:
posts = json.load(f)
posts_txt = []
for post in posts:
single_txt = f"""{post['author']} schrieb um {post['timestamp']}:
{post['text']}"""
posts_txt.append(single_txt)
all_posts = """
##########
""".join(posts_txt)
print(all_posts)