Tkinter program that displays 28 numbers on the screen I created a simple program that displays 28 numbers on the screen. 

from Tkinter import *
import random

class Game(Frame):

    def __init__(self, parent):
        Frame.__init__(self, parent, background="white")
        self.parent = parent
        self.parent.title("Centered window")
        self.pack(fill=BOTH, expand=1)
        self.centerWindow()

    def centerWindow(self):

        w = 850
        h = 530

        sw = self.parent.winfo_screenwidth()
        sh = self.parent.winfo_screenheight()

        x = (sw - w)/2
        y = (sh - h)/2
        self.parent.geometry('%dx%d+%d+%d' % (w, h, x, y))

def main():

    global tile_frame_column  # the labels that go on the screen of individual numbers
    tile_frame_column = {}

    global tiles_make_number  # dictionary of all the individual numbers
    tiles_make_number = {}

    global tile_frame_column_counter
    tile_frame_column_counter=0

    global tiles_make_number_counter
    tiles_make_number_counter=0

    global xpos
    xpos=35

    global ypos
    ypos=50

    tile_numbers = ['1', '2', '3', '4', '5', '6', '1', '2', '1', '2', '1', 'l', '1', '3', '4', '2', '1', '2', '1', '1', '2', '1', '1', '6', '4', '3', '2', '2']

    root = Tk()
    ex = Game(root)

    def add_number_to_screen():
        global tile_frame_column_counter
        global tiles_make_number_counter
        global tile_frame_column
        global xpos
        global ypos

        if not tile_numbers:
            return

        rand = random.choice(tile_numbers)
        tile_frame_column[tile_frame_column_counter] = Button(root, text=rand, font="Helvetica 16 bold")

        tile_frame_column[tile_frame_column_counter].place(x=xpos, y=ypos)
        tile_numbers.remove(rand)  # remove that tile from list of tiles
        xpos += 80
        if (len(tiles_make_number) % 7 == 0) &amp; (len(tiles_make_number) &gt; 0):
            xpos = 35
            ypos += 80
            tile_frame_column[tile_frame_column_counter].place(x=xpos, y=ypos)
            xpos += 80
        tiles_make_number[tiles_make_number_counter] = rand
        tile_frame_column_counter += 1
        tiles_make_number_counter += 1
        root.after(10, add_number_to_screen)

    root.after(10, add_number_to_screen)
    root.mainloop()


if __name__ == '__main__':
    main()


I want the main() function to be initialized, though. Whenever a game object is created I want it to automatically add the main function -- meaning add numbers to the screen. I think the way my code is now, when a game object is created it only creates the screen.

Any ideas?
For most of your question you will need to ask stack overflow specific question on each thing you want to do.

For example: You could ask a question about how to change the display of a button when said button is clicked. This kind of question is best suited for stack overflow.

However I can help you with making your existing code a bit better.

Lets take everything in your program and place it into a class. This will serve to make working with the code a much less painful process as we can work with class attributes and we do not need to worry about global variables. (Globals are bad Mmm Kaaa!)

Here is your code reworked into a class. For the rest you should ask a series of question on stack overflow :)

A few notes: Try to be more consistent with naming conventions. ClassName, functionName, variable_name. This will make the code easier to read and maintain. You might also want to change self.parent.geometry('%dx%d+%d+%d' % (w, h, x, y)) to use the .format() method instead as it is the correct method going forward and % is being fazed out.

from Tkinter import *
import random

class Game(Frame):

    def __init__(self, parent):
        Frame.__init__(self, parent, background="white")

        self.parent = parent
        self.parent.title("Centered window")
        self.pack(fill=BOTH, expand=1)
        self.centerWindow()

        self.tile_frame_column = {}
        self.tiles_make_number = {}
        self.tile_frame_column_counter=0
        self.tiles_make_number_counter=0
        self.xpos=35
        self.ypos=50

        self.tile_numbers = ['1', '2', '3', '4', '5', '6', '1', '2', '1', '2', '1', 'l', '1', '3', '4', '2', '1', '2', '1', '1', '2', '1', '1', '6', '4', '3', '2', '2']

        self.addNumbers()

    def centerWindow(self):
        w = 850
        h = 530
        sw = self.parent.winfo_screenwidth()
        sh = self.parent.winfo_screenheight()
        x = (sw - w) / 2
        y = (sh - h) / 2
        self.parent.geometry('%dx%d+%d+%d'%(w, h, x, y))


    def addNumbers(self):
        if not self.tile_numbers:
            return
        rand = random.choice(self.tile_numbers)
        self.tile_frame_column[self.tile_frame_column_counter] = Button(root, text=rand, font="Helvetica 16 bold")

        self.tile_frame_column[self.tile_frame_column_counter].place(x=self.xpos, y=self.ypos)
        self.tile_numbers.remove(rand)  # remove that tile from list of tiles
        self.xpos += 80
        if (len(self.tiles_make_number) % 7 == 0) &amp; (len(self.tiles_make_number) &gt; 0):
            self.xpos = 35
            self.ypos += 80
            self.tile_frame_column[self.tile_frame_column_counter].place(x=self.xpos, y=self.ypos)
            self.xpos += 80
        self.tiles_make_number[self.tiles_make_number_counter] = rand
        self.tile_frame_column_counter += 1
        self.tiles_make_number_counter += 1
        root.after(10, self.addNumbers)

if __name__ == '__main__':
    root = Tk()
    ex = Game(root)  
    root.mainloop()