Home > Net >  How to print same pack multiple times on GUI in tkinter
How to print same pack multiple times on GUI in tkinter

Time:07-28

import tkinter as tk

window = tk.Tk()

window.geometry("200x200")

options = tk.Label(text = "Text")

for i in range (3):
      options.pack()

tk.mainloop()

I want this to print "Text" in the gui, 3 times, on 3 different lines. Any help pls?

CodePudding user response:

import tkinter as tk

window = tk.Tk()

window.geometry("200x200")


for i in range (3):
      options = tk.Label(window, text="test label")
      options.pack()

tk.mainloop()

This will work.

CodePudding user response:

Run 3 Different Scripts

I suggest calling them

Script1.py Script2.py Script3.py

Let me know if this causes any issues!

  • Related