Nov-06-2024, 07:29 PM
(This post was last modified: Nov-06-2024, 09:02 PM by deanhystad.)
Thank you so much. So this is my coding. Where can I put that line of coding in this coding so the numbers will be superlarge like attached picture? You said to add this to the coding.
Add a font setting in this line in the call_number function
self.last_number.config(text=number)
Add this
self.last_number.config(text=number, font= ("Courier", 128))
Add a font setting in this line in the call_number function
self.last_number.config(text=number)
Add this
self.last_number.config(text=number, font= ("Courier", 128))
import random import tkinter as tk # Generate a list of all Bingo numbers bingo_numbers = ( ["B" + str(i) for i in range(1, 16)] + ["I" + str(i) for i in range(16, 31)] + ["N" + str(i) for i in range(31, 46)] + ["G" + str(i) for i in range(46, 61)] + ["O" + str(i) for i in range(61, 76)] ) # Shuffle the Bingo numbers randomly random.shuffle(bingo_numbers) # Create the main window using Tkinter root = tk.Tk() root.title("Bingo Caller") root.geometry("400x300") # Set the window size # Create a label to display the Bingo number label = tk.Label(root, text="Press 'Call Number' to start", font=("Helvetica", 100)) label.pack(pady=20) # Function to call the next Bingo number def call_number(): print("Button clicked!") # Debugging line to ensure the function is called if bingo_numbers: # Check if there are numbers left to call number = bingo_numbers.pop(0) label.config(text=number) print(f"Called number: {number}") # Debugging line to check if a number is being popped else: # If all numbers have been called label.config(text="All numbers called!") print("All numbers have been called.") # Debugging line # Create a button to call the next number button = tk.Button(root, text="Call Number", command=call_number, font=("Helvetica", 16)) button.pack(pady=20) # Run the Tkinter main loop root.mainloop()
(Nov-06-2024, 02:56 PM)menator01 Wrote: Add a font setting in this line in the call_number function
self.last_number.config(text=number)
Add this
self.last_number.config(text=number, font= ("Courier", 128))
deanhystad write Nov-06-2024, 09:02 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.