daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.   "tag" : "مو",
  3.   "id" : 1
  4. }
  5.    
  6. import json
  7. import re
  8.  
  9. raw_data = '''
  10. {
  11.   "tag" : "مو",
  12.   "id" : 1
  13. }
  14. '''
  15.  
  16. data = json.loads(raw_data)
  17. data['tag'] = re.sub(r'&#(d+);',lambda m: chr(int(m.group(1))),data['tag'])
  18. print(data)
  19.    
  20. {'tag': 'مو', 'id': 1}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top