Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def remove_emoji(path,mode):
- with open(path, 'r', encoding='utf8') as file_read:
- lines=file_read.read()
- words=lines.split()
- emoji_pattern = re.compile("["
- u"\U0001F600-\U0001F64F" # emoticons
- u"\U0001F300-\U0001F5FF" # symbols & pictographs
- u"\U0001F680-\U0001F6FF" # transport & map symbols
- u"\U0001F1E0-\U0001F1FF" # flags (iOS)
- u"\U00002702-\U000027B0"
- u"\U000024C2-\U0001F251"
- "]+", flags=re.UNICODE)
- return emoji_pattern.sub(r'', words)
- print(remove_emoji('D:\\python_practise\\read.txt','r'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement