TA的每日心情 | 奋斗 2020-12-22 18:46 |
---|
签到天数: 43 天 [LV.5]常住居民I
|
发表于 2019-10-29 16:45:45
|
显示全部楼层
大神,我有点没看懂帖子介绍的mac词典导出放大,我在推荐的apple dictionary主页找到了一条py代码并运行,显示出了这样的报错,请问该怎么办!
# x) W9 n- l R, W) yTraceback (most recent call last):8 H0 `9 K! Q: G' z9 Q
File "/Users/xxx/Downloads/macdictexport/0dedict.py", line 31, in <module>
; o( D1 ]9 Z+ X7 L1 | for word, definition in gen_entry():
! }3 E, ~3 m0 B( B( Q8 o& E File "/Users/xxx/Downloads/macdictexport/0dedict.py", line 26, in gen_entry c7 f3 l; |% @( Q
title = re.search('d:title="(.*?)"', entry).group(1)* a2 ^6 G" y1 o* H! b) C/ ^
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/re.py", line 199, in search
" S3 r- s6 Y# `5 V1 s. ?, ` return _compile(pattern, flags).search(string); c, S& j2 ?9 L/ f+ q
TypeError: cannot use a string pattern on a bytes-like object! o/ a3 K- [: y; y: X* K" y
>>> |
|