If you have any questions, comments or issues with this project please post them here!
So I have typed the code out exactly as it is within the lesson, but there is no text window like there should be. I tested the code outside of Replit just to make sure it wasnât a bug, but it didnât work there either. It seems like there is something missing.
Can you please share the code? I may or may not be up to day 66
import tkinter as tk
window = tk.Tk()
window.title(âGroovey Botâ) # Sets the name of the window in the border
window.geometry(â300x300â) # Sets the size of the window in pixels
label = 0
def updateLabel():
global label
label += 1
hello[âtextâ] = label
hello = tk.Label(text = label) # Creates a text box
hello.pack() # âpackâ places the element on the screen
button = tk.Button(text = âDonât Click me!â, command = updateLabel) # Creates a button
button.pack()
text = tk.Text(window, height=1, width=50)
text.pack
tk.mainloop()
There should be nothing being printed. There are no print statements so its working as intended. @DavidAtReplit can say if this is intentional.
Itâs supposed to put a text box that you can type into in the main window.
The next step in the lesson is using information that is typed into that text box.
Iâll grab my original solution repl and take a look
Is this not the code we put in the solution? https://replit.com/@DavidAtReplit/Day-66-Solution-1#main.py
And just to clarify the text box in this is just a label, itâs not meant to be typed into - the buttons are supposed to do the work
Yes, I figured it out. the text.pack was missing the () at the end. I watched the video again and noticed that it was in the video, but not in the tutorial window.
And the issue was before I got to the project, it was on the 2nd slide âAdding Textâ