Answer the question
In order to leave comments, you need to log in
How to make the text in the JSON module saved as Cyrillic?
If that produces such characters.
The code where I use this.
import json
def users_persone():
name = input('Введите имя контакта - ')
tel = input('Введите номер - ')
persone = {
name:tel
}
return persone
def main():
l = True
while l:
def main_2():
try:
data = json.load(open('persones.json'))
except:
data = []
data.append(users_persone())
with open('persones.json', 'w') as file:
json.dump(data, file, indent = 2, ensure_ascii = False)
print('Контакт добавлен ^_^')
users_choise = input("Желаете ввести или получить контакт - ")
if users_choise == 'ввести':
main_2()
elif users_choise == 'отримати':
users_input_name = input("Введіть ім'я користувача для номеру - ")
users_choise_two = input("Желаете остановить програму - ")
if users_choise_two == 'да':
print("Програма завершена ^_^")
l = False
main()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question