MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/a27d7u/render_3d_cube_wireframe_in_console/eaxzhfc/?context=3
r/Python • u/vanyakosmos • Dec 01 '18
39 comments sorted by
View all comments
1
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.
2
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.
Oh that's really cool. I haven't seen that before.
1
u/alexzoin Dec 02 '18 edited Dec 02 '18
Can someone explain this to me?
If __name__ == '__main__':
main()