Answer the question
In order to leave comments, you need to log in
The result is not written to notepad?
I have a Qt5 application and there is a "save" button, here is the function code for it:
def save_result():
open('result.txt', 'w').write("save test")
open('result.txt', 'w').close()
print('test')
ui.pushButton_2.clicked.connect(save_result) # Сохранить результат
Answer the question
In order to leave comments, you need to log in
file = open('result.txt', 'w')
file.write("save test")
file.close()
with open('result.txt','w') as file:
file.writelines('save test')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question