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
python_wiki:if_name_main [2014/11/24 22:42]
billdozor
python_wiki:if_name_main [2019/05/25 23:50] (current)
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.1416886957.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)