Difference between revisions of "If name == " main ":"

From wikieduonline
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
https://stackoverflow.com/questions/419163/what-does-if-name-main-do
 
https://stackoverflow.com/questions/419163/what-does-if-name-main-do
  
  <code>if __name__ == "__main__":</code>
+
  <code>[[if]] __name__ == "__main__":</code>
  
  
 
  if __name__ == "__main__":
 
  if __name__ == "__main__":
 
   main()
 
   main()
 +
 +
 +
if __name__ == "__main__":
 +
  yourfunction()
  
 
== Related terms ==
 
== Related terms ==
 
* [[Module]]
 
* [[Module]]
 
* <code>[[def]]</code>
 
* <code>[[def]]</code>
 +
* [[Python double under (dunder) methods]]
  
 
== See also ==
 
== See also ==
 +
* {{import}}
 
* {{Python}}
 
* {{Python}}
  
 
[[Category:Pyhon]]
 
[[Category:Pyhon]]

Latest revision as of 09:49, 27 March 2024

Advertising: