英文直接截取即可。 中文应字节长度会乱码,应先转unicode截取。 如下: #-*- coding:utf8 -*- s = u'截取中文' s.decode('utf8')[0:3].encode('utf8') 相关文章: 2022-12-23 2022-12-23 2022-12-23 2022-12-23 2022-12-23 2021-08-22 2021-11-21