Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pythonpreventing an import from executing without call

# stuff to run always here such as class/def
def main():
    pass

if __name__ == "__main__":
   # stuff only to run when not called via 'import' here
   main()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pythonpreventing #import #executing #call
ADD COMMENT
Topic
Name
7+2 =