Код:
userCommand = input('Введите команду: ') if userCommand == 'msg': repWrite = open('E:/Python/reports.txt', 'w', encoding = 'utf-8') reportForm = input('Введите текст: ') repWrite.write(reportForm)
userCommand = input('Введите команду: ') if userCommand == 'msg': repWrite = open('E:/Python/reports.txt', 'w', encoding = 'utf-8') reportForm = input('Введите текст: ') repWrite.write(reportForm)
repWrite.close()