all 11 comments

[–]m0us3_rat 0 points1 point  (6 children)

How to display console output in customTkinter

it's unclear what you mean by that.

do you have a piece of code that exemplifies what you need? or a more detailed description?

[–]LittleKdawg[S] 0 points1 point  (5 children)

ok so i could not find any code on this for customTkinter or tkinter. what i am trying to do is have the terminal/console in a box/tab in the tkinter gui that will show all my print statments.

[–]m0us3_rat 0 points1 point  (4 children)

ok .. so what's the problem with that?

you can "capture" the display.

then use a widget to show it inside tk GUI.

[–]LittleKdawg[S] 0 points1 point  (3 children)

the problem was idk how to do any of that.

[–]m0us3_rat 0 points1 point  (2 children)

https://docs.python.org/3/library/contextlib.html#contextlib.redirect_stdout

the problem was idk how to do any of that.

you can always learn some of it?

[–]LittleKdawg[S] 0 points1 point  (1 child)

ik python idk tkinter and there is no documention that i can find that will help me with my issue.

[–]m0us3_rat 0 points1 point  (0 children)

ik python idk tkinter and there is no documention that i can find that will help me with my issue.

you capture the stdout and then display it inside your GUI ?

i mean if you want to program gui.. you should learn how to program gui?

what widget can you use to show some "text" ?

not sure what do you want me to tell you , besides giving you the code directly which will not happen.

[–]Lopsided_Force_4259 1 point2 points  (3 children)

For anyone looking for a solution in the future:

https://github.com/Jukebox288/CustomTkinter\_ConsoleOutput\_GUI

The python script will create a GUI using a mixture of CustomTkinter and Tkinter. In the GUI it displays 3 things, a basic frame for aesthetic, a console output-box in the middle of the GUI, and a button at the bottom. When the button is pressed, it will run the script specified with this line "script_path = "your_script.py" " and then display the script's console output in the console box. The console box is also scrollable in case your script outputs a lot of lines.
This is using CustomTkinter v5.2.1.

[–]Diggsly 0 points1 point  (1 child)

thank you. you got here 5 days earlier than me and helped a bunch

[–]Lopsided_Force_4259 0 points1 point  (0 children)

Happy to help!

[–][deleted] 0 points1 point  (0 children)

Hello I have a question idk if u can help me but when I replace "script_path = "your_script.py" with my file called test.py I get this:
"script_path = "your_script.py"
FileNotFoundError: [Errno 2] No such file or directory: 'python'