TA的每日心情 | 奋斗 2020-12-22 18:46 |
---|
签到天数: 43 天 [LV.5]常住居民I
|
发表于 2019-10-29 16:45:45
|
显示全部楼层
大神,我有点没看懂帖子介绍的mac词典导出放大,我在推荐的apple dictionary主页找到了一条py代码并运行,显示出了这样的报错,请问该怎么办!/ x1 l* R( p4 V/ L9 l
Traceback (most recent call last):, g6 A- U& H+ ?/ G3 ? D9 ^3 Q
File "/Users/xxx/Downloads/macdictexport/0dedict.py", line 31, in <module>% I. ]0 Y) Y7 S; L% U( A
for word, definition in gen_entry():: R8 [- l' V( E0 _( ^& x
File "/Users/xxx/Downloads/macdictexport/0dedict.py", line 26, in gen_entry- ^; L4 z$ K( e$ k# v
title = re.search('d:title="(.*?)"', entry).group(1)
% ?/ W G2 E1 R2 ^- A" v File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/re.py", line 199, in search
8 |/ i7 H( ^4 [+ H7 v+ I- C; `6 x6 e# N return _compile(pattern, flags).search(string)& ~6 V$ t& q/ s9 m
TypeError: cannot use a string pattern on a bytes-like object
! B/ v7 _ ?6 E) k/ ]* z# w>>> |
|