Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

if __name__ ==

if __name__ == '__main__':     # Runs main() if file wasn't imported.
    main()
Comment

if __name__

# Python program to execute
# main directly
print ("Always executed")
 
if __name__ == "__main__":
    print ("Executed when invoked directly")
else:
    print ("Executed when imported")
Comment

PREVIOUS NEXT
Code Example
Python :: intersect in python list 
Python :: python get last element of list 
Python :: dataframe row print 
Python :: print last exceuted query python 
Python :: 1. write a program to multiply two numbers using function python 
Python :: distance matrix in python 
Python :: moving average pandas 
Python :: matplotlib show grid for log or logit 
Python :: hstack in numpy 
Python :: magic methods python 
Python :: skip element in list comprehension 
Python :: django unique together 
Python :: python multiline string 
Python :: replace multiple values in pandas column 
Python :: df rename columns 
Python :: how to import turtle in python 
Python :: sympy function definition 
Python :: django boilerplate command 
Python :: how to count backwards in for loop python 
Python :: python parcourir un dictionnaire 
Python :: check if two strings are anagrams python 
Python :: how to play video in colab 
Python :: python add two numbers 
Python :: python epoch to datetime 
Python :: python shortest distance between two points 
Python :: python if in list multiple 
Python :: ardent 
Python :: flask template split string 
Python :: python overwrite line print 
Python :: pandas index to datetime 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =