Most programmers that have worked with C or C-like languages are familiar with the main() function.  Its the heart of the program and from where all other portions of the code execute.  Python doesn't have a built-in main() function so it can be a little foreign to people like me so I found a way to create a main() and have my code structured more like I'm used to.  Its actually quite simple to do.

def main():

     <your python here>

if __name__ == "__main__":
    sys.exit(main())

Thats it.  You'll declare a function called main and call it with the two lines at the bottom.  Now you can structure your code with other functions and classes and have everything originate from the main().