python_wiki:if_name_main

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
python_wiki:if_name_main [2014/11/24 22:42]
billdozor
python_wiki:if_name_main [2016/11/30 22:00]
billdozor [if __name__ main]
Line 1: Line 1:
 ====== if __name__ main ====== ====== if __name__ main ======
  
-Many python source files include a section like this:+**General Information** 
 + 
 +Many python source files will have an interesting if statement around main(). This is why it exists. 
 + 
 +**Checklist** 
 +  * Python versions2 and 3 
 + 
 +---- 
 + 
 +===== The Code =====
  
 <code python> <code python>
Line 7: Line 16:
   main()   main()
 </code> </code>
 +
 +==== Explanation ====
  
 It may include other statements as well. It may include other statements as well.
  • python_wiki/if_name_main.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)