Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import re
  2. def remove_emoji(path,mode):
  3.     with open(path, 'r', encoding='utf8') as file_read:
  4.         lines=file_read.read()
  5.         words=lines.split()
  6.         emoji_pattern = re.compile("["
  7.         u"\U0001F600-\U0001F64F" # emoticons
  8.         u"\U0001F300-\U0001F5FF" # symbols & pictographs
  9.         u"\U0001F680-\U0001F6FF" # transport & map symbols
  10.         u"\U0001F1E0-\U0001F1FF" # flags (iOS)
  11.         u"\U00002702-\U000027B0"
  12.         u"\U000024C2-\U0001F251"
  13.         "]+", flags=re.UNICODE)
  14.         return emoji_pattern.sub(r'', words)
  15. print(remove_emoji('D:\\python_practise\\read.txt','r'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement