python_wiki:argument_parser

Differences

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

Link to this comparison view

Next revision
Previous revision
python_wiki:argument_parser [2017/09/02 18:35]
billdozor created
python_wiki:argument_parser [2019/05/25 23:50] (current)
Line 22: Line 22:
  
 <code python program-name.py> <code python program-name.py>
 +#!/usr/bin/python
 #======================= #=======================
 # Import Modules # Import Modules
Line 41: Line 42:
 if args['test'] == True: if args['test'] == True:
   print("-->> Test run...no modifications will be made <<--")   print("-->> Test run...no modifications will be made <<--")
-  +
  
 #- Using stored variables from arguments -# #- Using stored variables from arguments -#
Line 48: Line 49:
 print("Your name is: " + args['name']) print("Your name is: " + args['name'])
  
-if args['email'] == 'True':+if args['email'] == True:
   print("Emailing results...")   print("Emailing results...")
-else+else:
   print("Will NOT email results.")   print("Will NOT email results.")
 </code> </code>
  • python_wiki/argument_parser.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)