Detecting the script

  • Comments posted to this topic are about the item Detecting the script

  • Interesting question, thanks, Steve
    Learned something.
    just wondering where one would use this.

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • You use this to ensure a module can be run standalone or imported. If I import this, this code doesn't run

    if  __name__ == __main__:
         Dothing()

    However, if I had a function above this, I could still call it. It's a great trick for test/debugging a function. Put something in this call to test your specific case.

  • I guessed... wrong!

    Haha, learned something.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply