For me (Win 7, Py2.7), your example comes up with the branch closed, but you can open or close it as you like with this command:
tree.item("Main", open=False)
Set it to False to close it.
See these topics:
25.2. tkinter.ttk - Tk themed widgets - Item options
25.2. tkinter.ttk - Tk themed widgets - item method
Item options can be set either with insert()
, or after the fact with item()
.