Guest User

Untitled

a guest
Jan 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def on_message(self, message):
  2. print message
  3. for x in self.connections:
  4. if x['id'] == self:
  5. print 'found something'
  6. x['keyword'] = message
  7. print x['keyword']
  8. print x
  9.  
  10. for dict in self.connections:
  11. if dict['id'] == self:
  12. dict['keyword'] = 'updated'
  13.  
  14. for dict in [dict for dict in self.connections if dict['id'] == self]:
  15. dict['keyword'] == 'updated'
  16.  
  17. for dict in self.connections:
  18. if dict['id'] == self:
  19. self.connections.remove(dict)
Add Comment
Please, Sign In to add comment