Advertising (This ad goes away for registered users. You can Login or Register)

python GUI: lottery generator

Programming on your favorite platform, for your favorite platform? Post here
Post Reply
Posts: 3
Joined: Wed Apr 30, 2014 7:46 pm

python GUI: lottery generator

Post by byfailx »

lottery generator with GUI in python 3.3,
need to combine two functions don't really know how,
help?, please

here is the code


Code: Select all

#Lottery Generator
#import modules for creating a GUI...
import tkinter
#...and for picking random numbers.
import random
nums = []
#gens numbers
def generate_num():
    nums = []
    *** = [i for i in range(1,50)]
    nums = ***[:6]
#a function that will pick (and display) a name.
def pickNum():
#combines functions???
def combine_funcs(*funcs):
    def combined_func(*generate_num, **pickNum):
        for f in funcs:
            f(*generate_num, **pickNum)
    return combined_func
#the possible numbers.
numbers = [nums]
#create a GUI window.
root = tkinter.Tk()
#set the title.
root.title("Lottery Generator")
#set the size.
#add a label for displaying the numbers.
nameLabel = tkinter.Label(root, text="", font=('Helvetica', 32))
#add a 'generate' button
pickButton = tkinter.Button(text="generate",command=combined_func)
#start the GUI
thanks in advance
Last edited by fate6 on Thu Nov 06, 2014 9:38 pm, edited 1 time in total.
Reason: Moved to PC/Programming
Retired Mod
Posts: 3100
Joined: Tue May 01, 2012 11:32 am
Location: Behind you!

Re: python GUI: lottery generator

Post by Acid_Snake »

What do you mean by combining two functions?
Posts: 52
Joined: Mon Apr 16, 2012 4:59 pm
Location: Hawaii

Re: python GUI: lottery generator

Post by Gilgamesh »

What do you want it to do? Return a number from a randomly generated list?
"The sidekick is NOT to ditch the hero!"
Post Reply

Return to “Programming”