Attachment 'generic_script.py'

Download

   1 #!/usr/bin/env python
   2 
   3 '''
   4 doc string explaining this script
   5 '''
   6 
   7 
   8 import sys
   9 from matplotlib import pyplot as mmp
  10 
  11 
  12 
  13 def function1(parameter1, upperCase=False):
  14  '''
  15  function specific docstring.'''
  16 
  17 
  18  if not upperCase:
  19      variable = parameter1
  20  else:
  21      variable = parameter1.upper()
  22  return variable
  23 
  24 
  25 def main():
  26     '''
  27     This is the main function.
  28     '''
  29 
  30     string = 'hello world'
  31 
  32     result1 = function1(string, upperCase=True)
  33     print result1
  34 
  35 
  36 if __name__ == '__main__':
  37     '''This should also have a doc string.'''
  38 
  39     main()
  40     sys.exit('\n This is the end\n)

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2012-07-20 10:56:01, 0.6 KB) [[attachment:generic_script.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.