r/Python • • Dec 01 '18

render 3d cube wireframe in console

1.2k Upvotes

39 comments sorted by

View all comments

1

u/alexzoin Dec 02 '18 edited Dec 02 '18

Can someone explain this to me?

If __name__ == '__main__':

    main()

2

u/vanyakosmos Dec 02 '18

if script was launched directly (python this_script.py) then run main(). if script was just imported from another script then don't run main()

1

u/alexzoin Dec 02 '18

Oh that's really cool. I haven't seen that before.