Advertisement
LuisEdu

Solution2

Jul 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.01 KB | None | 0 0
  1. import datetime
  2.  
  3. entries = [('CHG200005971065', {'Status': 'Pending', 'Category': 'Aplicaciones', 'Change ID+': 'CHG200005971065',
  4.                                 'Supervisor Name+': 'FULANO', 'Naturaleza': None, 'Implementor Name+': None,
  5.                                 'Region': 'Brasil', 'Supervisor Group+': 'SUPERVISORGROUP',
  6.                                 'Create-date': datetime.datetime(2017, 7, 18, 22, 59, 53), 'Summary': 'teste',
  7.                                 'Priority': 'P5', 'Item': 'Soporte', 'Entorno': 'Production',
  8.                                 'Requester Name+': 'siclano', 'Type': 'type for test'}),
  9.            ('CHG200005971065',{'Status': 'Pending','Category': 'Aplicaciones','Change ID+': 'CHG200005971065',
  10.                                'Supervisor Name+': 'FULANO','Naturaleza': None,'Implementor Name+': None,
  11.                                'Region': 'Brasil','Supervisor Group+': 'SUPERVISORGROUP',
  12.                                'Create-date': datetime.datetime(2017, 7, 18, 22, 59, 53),
  13.                                'Summary': 'teste','Priority': 'P5','Item': 'Soporte','Entorno': 'Production',
  14.                                'Requester Name+': 'siclano','Type': 'type for test'}),
  15.            ('CHG200005971065', {'Status': 'Pending', 'Category': 'Aplicaciones', 'Change ID+': 'CHG200005971065',
  16.                                'Supervisor Name+': 'FULANO', 'Naturaleza': None, 'Implementor Name+': None,
  17.                                'Region': 'Brasil', 'Supervisor Group+': 'SUPERVISORGROUP',
  18.                                'Create-date': datetime.datetime(2017, 7, 18, 22, 59, 53), 'Summary': 'teste',
  19.                                'Priority': 'P5', 'Item': 'Soporte', 'Entorno': 'Production',
  20.                                'Requester Name+': 'siclano', 'Type': 'type for test'})]
  21.  
  22. list = []
  23.  
  24. for entry_id, entry_values in entries:
  25.     dic = {}
  26.     for field, value in entry_values.items():
  27.         dic[field] = value
  28.     list.append((entry_id, dic))
  29.  
  30. for i in list:
  31.     print(i,'\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement