code: def select(i):
      
  
      s=''
  
      title=i.get('title','')
      if title!='':
         out(title)
         out('')
  
      d=i['dict']
      if i.get('skip_sort','')!='yes':
         kd=sorted(d, key=lambda v: d[v].get('sort',0))
      else:
         kd=d
  
      j=0
      ks={}
      for k in kd:
          q=d[k]
  
          sj=str(j)
          ks[sj]=k
  
          qn=q.get('name','')
  
          out(sj+') '+qn)
  
          j+=1
  
      out('')
      rx=inp({'text':'Make your selection (or press Enter for 0): '})
      if rx['return']>0: return rx
      sx=rx['string'].strip()
  
      if sx=='':
         if i.get('error_if_empty','')=='yes':
            return {'return':1, 'error':'selection is empty'}
  
         s=kd[0]
      else:
         if sx not in ks:
            return {'return':1, 'error':'selection is not recognized'}
         s=ks[sx]
  
      return {'return':0, 'string':s}
docs: Input:  {
                dict             - dict with values being dicts with 'name' as string to display and 'sort' as int (for ordering)
                (title)          - print title
                (error_if_empty) - if 'yes' and Enter, make error
                (skip_sort)      - if 'yes', do not sort array
              }
  
      Output: {
                return       - return code =  0
  
                string       - selected dictionary key
              }