reformat file to spaces before and after equal sign
This commit is contained in:
parent
d39dd9d484
commit
a8b5020419
31
journal.py
31
journal.py
|
|
@ -37,43 +37,42 @@ journal = ttk.Frame(journal)
|
||||||
journal.pack()
|
journal.pack()
|
||||||
|
|
||||||
# name
|
# name
|
||||||
name_label = ttk.Label(journal, text="Dein Name:")
|
name_label = ttk.Label(journal, text = "Dein Name:")
|
||||||
name_label.pack(fill='x', expand=True)
|
name_label.pack(fill = 'x', expand = True)
|
||||||
name_entry = ttk.Entry(journal, textvariable=name)
|
name_entry = ttk.Entry(journal, textvariable = name)
|
||||||
name_entry.pack(fill='x', expand=True)
|
name_entry.pack(fill = 'x', expand = True)
|
||||||
name_entry.focus()
|
name_entry.focus()
|
||||||
|
|
||||||
# textbox
|
# textbox
|
||||||
message_label = tk.Label(journal, text="Deine Nachricht:")
|
message_label = tk.Label(journal, text = "Deine Nachricht:")
|
||||||
message_label.pack(fill='x', expand=True)
|
message_label.pack(fill = 'x', expand = True)
|
||||||
#message_text = ttk.Text(journal, height=50)
|
#message_text = ttk.Text(journal, height = 50)
|
||||||
message_text = tk.Text(journal)
|
message_text = tk.Text(journal, height = 50)
|
||||||
message_text.pack()
|
message_text.pack()
|
||||||
|
|
||||||
|
|
||||||
def send_button_clicked():
|
def send_button_clicked():
|
||||||
with open(journal_filename_path, "a") as journal_of_the_day:
|
with open(journal_filename_path, "a") as journal_of_the_day:
|
||||||
journal_of_the_day.write(name.get() + "\n")
|
journal_of_the_day.write(name.get() + "\n")
|
||||||
message_text_str=message_text.get()
|
journal_of_the_day.write(message_text.get() + "\n")
|
||||||
journal_of_the_day.write(message_text_str + "\n")
|
|
||||||
journal_of_the_day.write("-----------------\n")
|
journal_of_the_day.write("-----------------\n")
|
||||||
showinfo(title="Information", message="Deine Nachricht wurde gespeichert")
|
showinfo(title = "Information", message = "Deine Nachricht wurde gespeichert")
|
||||||
|
|
||||||
|
|
||||||
# Send Button
|
# Send Button
|
||||||
button_send = ttk.Button(
|
button_send = ttk.Button(
|
||||||
journal,
|
journal,
|
||||||
text="Abschicken",
|
text = "Abschicken",
|
||||||
# command=lambda: showinfo(title="Information", message="Deine Nachricht wurde gespeichert")
|
# command = lambda: showinfo(title = "Information", message = "Deine Nachricht wurde gespeichert")
|
||||||
command=lambda: send_button_clicked()
|
command = lambda: send_button_clicked()
|
||||||
)
|
)
|
||||||
button_send.pack()
|
button_send.pack()
|
||||||
|
|
||||||
# Quit Button
|
# Quit Button
|
||||||
button_quit = ttk.Button(
|
button_quit = ttk.Button(
|
||||||
journal,
|
journal,
|
||||||
text="Speichern und Beenden",
|
text = "Speichern und Beenden",
|
||||||
command=lambda: journal.quit()
|
command = lambda: journal.quit()
|
||||||
)
|
)
|
||||||
button_quit.pack()
|
button_quit.pack()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user