← 输入框|github.com|刷新
Skip to content

There is no mention of if __name__ == '__main__' in the book #5

Open

Description

@jbarnoud

The book does not mention the if __name__ == '__main__'. The only two mention I found by searching for __name__ are a commented exercise in appendix A, and a brief appearance in the pygame appendix.

Activity

  1. Eljee commented on Apr 19, 2016

    @Eljee
    Collaborator

    Before the course started, this was discussed briefly over coffee. A lot of the students only work in spyder and because of this I don't think many will use it. The few that want to run scripts without spyder and use if __name__ == '__main__' could benefit from an explanation, however. Should we add this to the book? Or provide a solid 'Further Reading' section?

  2. jbarnoud commented on Apr 19, 2016

    @jbarnoud
    CollaboratorAuthor

    On 19/04/16 10:13, Lourens-Jan Ugen wrote:

    Before the course started, this was discussed briefly over coffee. A
    lot of the students only work in spyder and because of this I don't
    think many will use it. The few that want to run scripts without
    spyder and use |if name == 'main'| could benefit from an
    explanation, however. Should we add this to the book? Or provide a
    solid 'Further Reading' section?

    —
    You are receiving this because you authored the thread.
    Reply to this email directly or view it on GitHub
    https://github.com/tBuLi/HowToThink/issues/5#issuecomment-211786359

    Indeed, the use of spyder makes the question non-relevant for most
    student. Maybe we can consider the trick as "advanced".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions