From 4266bc27abe156d0625bb999a3ca5baa9b3d6094 Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 20 Jan 2024 00:11:16 +0100 Subject: [PATCH] =?UTF-8?q?mit=20lambda=20im=20button=20command=20wird=20d?= =?UTF-8?q?ie=20funktion=20erst=20bei=20klick=20ausgef=C3=BChrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- journal.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/journal.py b/journal.py index ee7e8f1..dde9a86 100755 --- a/journal.py +++ b/journal.py @@ -49,9 +49,9 @@ message_text.pack() def send_button_clicked(name, message): with open(journal_filename_path, "a") as journal_of_the_day: - journal_of_the_day.write(name.get()) - journal_of_the_day.write(message.get()) - journal_of_the_day.write("-----------------") + journal_of_the_day.write(name.get() + "\n") + journal_of_the_day.write(message.get() + "\n") + journal_of_the_day.write("-----------------\n") showinfo(title="Information", message="Deine Nachricht wurde gespeichert") # Send Button @@ -59,7 +59,7 @@ button_send = ttk.Button( journal, text="Abschicken", #command=lambda: showinfo(title="Information", message="Deine Nachricht wurde gespeichert") - command=send_button_clicked(name, message) + command=lambda: send_button_clicked(name, message) ) button_send.pack()