This is a simple customtkinter code with a textbox area.
import import customtkinter as ctk
def print_something():
print ('Print some text\n' * 50)
# Appearance window
ctk.set_appearance_mode('system') # Modes: system (default), light, dark
ctk.set_default_color_theme('blue') # Themes: blue (default), dark-blue, green
# Create main window
main_window = ctk.CTk()
main_window.geometry('400x400')
main_window.title('Login')
# Create textbox
textbox = ctk.CTkTextbox(main_window)
textbox.pack()
print_something()
main_window.mainloop()
How can i redirect in real time the terminal output to the textbox (errors, print's, etc.)?
I try this:
textbox = ctk.CTkTextbox(main_window)
textbox.insert('0.0', print_something)
textbox.pack()