def list_pic(fp, pic, alias):
   """ list all pins and their aliases of a single pic in dictionary alias
   """
   def list_aliases(aliaslist):
      if (len(aliaslist) > 0):                              # at least 1 alias
         return ('\n          "' + pin + '" : ["' + '", "'.join(aliaslist) + '"]')
      else:
         return ('\n          "' + pin + '" : []')          # no aliases

   pins = sorted(list(alias.keys()))                        # sorted list
   pl = []
   for i in range(len(pins)):
      pin = pins[i]
      pl.append(list_aliases(alias[pin]))
   fp.write('   "' + pic + '": \n          {' + ', '.join(pl) + "\n          }")