Python Forum
General Coding - Bingo Generator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General Coding - Bingo Generator
#6
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))

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.
Reply


Messages In This Thread
General Coding - Bingo Generator - by Playpatterns - Nov-04-2024, 02:24 PM
RE: General Coding - Bingo Generator - by menator01 - Nov-05-2024, 11:34 PM
RE: General Coding - Bingo Generator - by menator01 - Nov-06-2024, 02:56 PM
RE: General Coding - Bingo Generator - by Playpatterns - Nov-06-2024, 07:29 PM
RE: General Coding - Bingo Generator - by menator01 - Nov-06-2024, 08:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  coding a loot generator matt1984 1 1,275 Aug-16-2023, 05:08 AM
Last Post: Pedroski55
  General Coding Help biswajitmaity 2 2,376 Aug-25-2021, 03:04 PM
Last Post: jefsummers
  General coding Ellimann 2 3,052 Aug-25-2020, 05:43 AM
Last Post: buran
  General coding help prathmesh 1 2,429 Apr-01-2020, 01:23 PM
Last Post: buran
  general coding error karai 1 3,098 Mar-21-2018, 06:36 AM
Last Post: Gribouillis
  receive from a generator, send to a generator Skaperen 9 7,218 Feb-05-2018, 06:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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