python turtle graphics window won't open
Question: I have little piece of code from a tutorial which should work fine but I don't
get the turtle graphics window to show (I'm on Windows 10 using python
2.7.10). The code looks like this

    
    
    import turtle
    
    def draw_square():
        window = turtle.Screen()
        window.bgcolor("red")
    
        brad = turtle.Turtle()
        brad.forward(100)
    
    window.exitonclick()
    

However, when I execute it nothing happens, I don't even get an error message.
Instead, the shell just says

================================ RESTART ================================

and displays the little Windows circle (indicating it is working on something)
but the turtle graphics window does not pop up.

I have tried repairing my python installation and additionally installing the
x86 version, but I get the same outcome on the other installation, too.

Does anyone please know how to fix this?

Thank you, Tomislav


Answer: Functions don't do anything unless you call them. Try:

    
    
    import turtle
    
    def draw_square():
        window = turtle.Screen()
        window.bgcolor("red")
    
        brad = turtle.Turtle()
        brad.forward(100)
    
        window.exitonclick()
    
    draw_square()
    

