Python Forum
[Tkinter] How to show text in window?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] How to show text in window?
#1
Hello,
I am looking for help having the text that outputs on the Command Prompt to show on the black box on this program. Any ideas on how to make this happen?
import tkinter as tk
from tkinter import filedialog, Text
import os
import time
import numpy as np
import urllib3 
root=tk.Tk()                   
def forecast():
    print("My Forecast")
def models():
    print("Models selected. ")
canvas = tk.Canvas(root, height=480, width=640, bg='black')
canvas.pack()

frame = tk.Frame(root, bg='black')
frame.place(relwidth=0.6, relheight=0.6, relx=0.1, rely=0.1)
forecast = tk.Button(root, text="Forecasts", padx=2, pady=3, fg='white', bg="red", command = forecast)
forecast.pack()

models = tk.Button(root, text="Models", padx=2, pady=3, fg='white', bg="red", command = models)
models.pack()
Output:
Models selected. My Forecast
(Buttons also show as part of the GUI)
Reply


Messages In This Thread
How to show text in window? - by wxnerd - Jun-20-2020, 03:23 PM
RE: TKinter: Same Window Help - by Yoriz - Jun-20-2020, 03:34 PM
RE: TKinter: Same Window Help - by wxnerd - Jun-20-2020, 03:53 PM
RE: TKinter: Same Window Help - by Yoriz - Jun-20-2020, 04:01 PM
RE: TKinter: Same Window Help - by wxnerd - Jun-20-2020, 04:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 530 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  Transparent window background, but not text on it muzicman0 7 2,888 Feb-02-2024, 01:28 AM
Last Post: Joically
  [PyQt] Hover over highlighted text and open popup window DrakeSoft 2 1,528 Oct-29-2022, 04:30 PM
Last Post: DrakeSoft
  tkinter window and turtle window error 1885 3 6,741 Nov-02-2019, 12:18 PM
Last Post: 1885
  [Tkinter] Text window not properly sized smabubakkar 1 1,929 Jun-16-2019, 08:55 AM
Last Post: Yoriz
  [PyQt] Can't show PyQt5 mediaPlayer in window DecaK 1 5,399 Sep-15-2018, 09:54 AM
Last Post: Axel_Erfurt
  update a variable in parent window after closing its toplevel window gray 5 9,106 Mar-20-2017, 10:35 PM
Last Post: Larz60+
  Show second window using classes iFunKtion 2 3,760 Feb-10-2017, 12:50 PM
Last Post: iFunKtion
  Show GPG keys in pyqt5 window Fred Barclay 1 4,621 Oct-24-2016, 07:09 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020