方法一:

emoji处理库,emoji官网:https://pypi.org/project/emoji/

#安装 
pip install emoji

官方例子如下:

python3 清除过滤emoji表情

清除命令:

emoji.demojize(str)

 方法二:

def filter_emoji(desstr,restr=''):  
    #过滤表情   
    try:  
        co = re.compile(u'[\U00010000-\U0010ffff]')  
    except re.error:  
        co = re.compile(u'[\uD800-\uDBFF][\uDC00-\uDFFF]')  
    return co.sub(restr, desstr)  

 打印所有的特殊字符:

for i in range(0x0,0x10ffff):
    print(chr(i),end=" ")
    if i%16==15:
        print()

打印结果:

python3 清除过滤emoji表情

 

相关文章:

  • 2021-12-13
  • 2022-12-23
  • 2021-12-24
  • 2021-12-27
  • 2021-10-06
  • 2021-05-23
  • 2022-12-23
  • 2022-02-28
猜你喜欢
  • 2021-06-11
  • 2021-09-20
  • 2021-11-26
  • 2022-01-21
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案