Files
Tg-bot/bot.0.1/other_packages/used_programs/to_json/to_json.py
2024-10-29 16:09:13 +03:00

18 lines
576 B
Python
Executable File

import json
ar = []
with open('censorship.txt', encoding='utf-8') as read_file:
for i in read_file:
n = i.lower().split("\n")[0]
if n != "":
ar.append(n)
with open('censorship.json', "w", encoding='utf-8') as write_file:
json.dump(ar, write_file)
# with open('name_dict.txt', encoding='utf-8') as read_file:
# for i in read_file:
# n = i.lower().split("\n")[0]
# if n != "":
# ar.append(n)
# with open('name_dict.json', "w", encoding='utf-8') as write_file:
# json.dump(ar, write_file)