old_contents: #!/usr/bin/python
  
  from Tkinter import *
  import tkMessageBox
  import subprocess
  import random
  
  n = 0 #size n to allocate start point of model name
  with open('models/Makefile.am') as f:
      for lines in f:
          for words in lines.split():
              if words == '=':
                  break;
              else:
                  n+=1
  
  models = lines.split()
  del models[0:n+1]
  
  def conf_choice():
      tmpfile = '/tmp/help' + str(random.randint(0,100))
      run_command = './models/' +  model_var.get() + '/' + model_var.get() + '_sim --help > ' + tmpfile
      subprocess.call(run_command, shell = True)
      read_status = False
      with open(tmpfile) as f:
          for lines in f:
              # filter out the unnecessary commands before 'where'
              if not read_status:
                  if 'Where:' in lines:
                      read_status = True
                  continue
  
              # filter out the white spaces
              if not lines.strip(): continue
  
              print lines
  
      
  
  def run_choice():
      run_command = './models/' +  model_var.get() + '/' + model_var.get() + '_sim'
      subprocess.call(run_command, shell = True)
  
  master = Tk()
  #master.geometry('200x100')
  
  model_var = StringVar()
  
  model_var.set(models[0])
  
  modelMenu = OptionMenu(master, model_var, *models)
  Label(master, text = 'Choose the Simulation Model\t').pack(side = LEFT)
  modelMenu.pack(side = LEFT)
  
  run_button = Button(master, text = '  Run Default  ', command = run_choice)
  run_button.pack(side = LEFT)
  
  conf_button = Button(master, text = '  Configure  ', command = conf_choice)
  conf_button.pack(side = LEFT)
  
  
  mainloop()
  
  
new_contents: #!/usr/bin/python
  
  from Tkinter import *
  import tkMessageBox
  import subprocess
  import random
  
  n = 0 #size n to allocate start point of model name
  with open('models/Makefile.am') as f:
      for lines in f:
          for words in lines.split():
              if words == '=':
                  break
              else:
                  n+=1
  
  models = lines.split()
  del models[0:n+1]
  
  def conf_choice():
      tmpfile = '/tmp/help' + str(random.randint(0,100))
      run_command = './models/' +  model_var.get() + '/' + model_var.get() + '_sim --help > ' + tmpfile
      subprocess.call(run_command, shell = True)
      read_status = False
      with open(tmpfile) as f:
          for lines in f:
              # filter out the unnecessary commands before 'where'
              if not read_status:
                  if 'Where:' in lines:
                      read_status = True
                  continue
  
              else:
                  entry_flag = False
                  # filter out the white spaces
                  if not lines.strip(): continue
  
                  for words in lines.split():
                      # find the argument
                      if '--' in words:
                          entry_flag = True
                          print words
                      # entry variable attach to arg exist or not
                      if entry_flag:
                          if '<' in words:
                              print words
                  # ignore argument line only save explaination
                  if '   -' not in lines:
                      print lines
  
  
  
  def run_choice():
      run_command = './models/' +  model_var.get() + '/' + model_var.get() + '_sim'
      subprocess.call(run_command, shell = True)
  
  master = Tk()
  #master.geometry('200x100')
  
  model_var = StringVar()
  
  model_var.set(models[0])
  
  modelMenu = OptionMenu(master, model_var, *models)
  Label(master, text = 'Choose the Simulation Model\t').pack(side = LEFT)
  modelMenu.pack(side = LEFT)
  
  run_button = Button(master, text = '  Run Default  ', command = run_choice)
  run_button.pack(side = LEFT)
  
  conf_button = Button(master, text = '  Configure  ', command = conf_choice)
  conf_button.pack(side = LEFT)
  
  
  mainloop()
  
subject: modify the filter for the command lines from --help