TA的每日心情 | 擦汗 2021-11-17 09:18 |
---|
签到天数: 79 天 [LV.6]常住居民II
|
各位大神好! 我在尝试使用PYGLOSSARY 制作mac词典出现了问题?5 E6 [! k- K6 k4 |
& q- _1 Z: }2 ~
我的环境
5 [+ A) C# g r- macOS Big Sur 11.5.2
1 q4 s9 `6 h5 Q& l2 b" A - python 3.9.6
复制代码
+ g5 m0 X+ J9 l
( k0 ?$ l/ b/ y3 ?
% z4 u5 _0 S m% p+ ]7 }; A目前成功安装. P3 t5 |1 ]: K: g% i) ~
- Q* E0 r$ W* k: |: M7 ^
- beautifulsoup 4 4.9.3
+ [, V; F4 ?' n - html5lib 1.15 |8 v# D# _+ H- |$ H
- lxml 4.6.3, M/ Q0 ^# L2 v
- python-lzo 1.12
复制代码 # P4 U5 @# W- s
# B9 N P& x) D3 `0 T: c0 u ( W" B7 n) s4 F5 k* l
9 ^) z& a4 x. ?) T* W' h Command Line Tools for Xcode 12.5.1 安装成功 z# V( R4 Y" c+ V2 ^
Auxiliary Tools 内 Dictionary Development Kit 我复制到 /Applications/Utilities1 C" o5 q {6 v# ~
& [. `/ } B) |( O' y9 \$ c& k( N% g/ w' @. K7 |
pyglossary 我下载的最新版 4.1.0rc2 ,解压到 /Users/liliane/Software0 b- Y3 C* ~: i. ^4 `; j
# l6 E8 \1 M3 M
% a: N9 B) \9 i" b4 q7 w
* Q* j: Y8 y# l7 _& r0 x然后执行命令' z/ ?' O- ?% B( l+ q( d2 R, N
- cd ~/Downloads/OALD4
2 t4 t& r5 o4 r" m& [ - python ~/Software/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict OALD4_Ex.mdx OALD4_Ex.xml
复制代码 9 D7 ~! [* r: _! u/ C0 x1 S
$ ^! k( o6 M6 h9 ?. N
; r1 g! ? H/ S4 }- p
+ q, H/ x; Q! E! {8 q: ]$ h给出报错! T% U/ }+ W5 s6 m {
- [ERROR] Invalid option name resPath for format OctopusMdict
复制代码 ) V9 Y: }3 K+ R2 J, ?9 A; t
- A( @" | \, ^; ]3 A8 I/ l* R5 q
# Z0 @5 r; _3 `: x5 J; t" h& g
9 m, }9 M5 t7 K5 U; ~! `- E; J- x- ~% W2 Z( g1 I" E7 ^% J7 K
运行- T# `4 O; o* q P$ B
- python ~/Software/pyglossary/pyglossary.pyw --help
复制代码
, h& o4 d+ n( v- s+ |4 u7 g# L- f6 `7 {
- PyGlossary is a tool for working with dictionary databases (glossaries)
% n( ]% y( i- p3 z0 X; m, g - Basic Usage:# X1 L. }( P) l# A: ^" W& B
- PyGI (Gtk3) Interface:7 I# k2 H4 {5 L. Z
- To open PyGlossary window:
! [% V* L9 l/ ?' I2 Y - pyglossary
" @, `6 v9 l. z9 i6 i - PyGI is the default interface (so you never need to use "--ui=gtk" or --gtk option)
0 n$ r, |6 q! N( D' X1 q1 \0 O - If PyGI was not found (not installed), then PyGlossary will fallback to Tkinter interface.3 O# N$ p# V4 f1 U+ \( a" I
- Tkinter Interface:
- |# \$ i( T( h8 H" h - To open PyGlossary window:
2 V F9 V0 \+ `, v3 S - pyglossary --tk$ x7 N6 X5 I/ r0 I u6 V1 J
- Or
9 f+ N, n9 l. C( n. S: X$ P! H - pyglossary --ui=tk" b% p, {1 u# \/ [
- Usually good for Windows and Mac OS X
; q* o0 d# `# f - Command-line interface:
: c/ ?; }: e1 Z! j- ?+ W - To show this help:
3 ^: N# Y0 m+ z+ J4 e8 D* L7 u - pyglossary --help
) N$ Q: _+ D2 c% Q" f) [" ] - To show program version:& `8 g9 q" o) y3 v9 n
- pyglossary --version
( }# { C3 V3 h ?. ~ - To Convert:# Z6 @9 O- R# k/ w5 w
- pyglossary INPUT_FILE OUTPUT_FILE6 F6 G! d& A6 n
- To Reverse:! f$ R( J. s1 a* @$ ^7 t
- pyglossary INPUT_FILE OUTPUT_FILE.txt --reverse) `- T) \& ~8 g, N; l
- Input and output formats will be detected from extensions if possible.' O1 s5 P2 R: }/ \% t5 z; O
- If not, you need to specify input or output format, for example:( D3 |' E) ]- K* x
- pyglossary test.utf8 test.ifo --read-format=tabfile h3 `4 X' \$ f6 z) l" N
- pyglossary test.utf8 test.ifo --read-format tabfile
4 _/ c, Q! T# ?( w - pyglossary test.ifo test.utf8 --write-format=tabfile
$ {- w3 u( x( r8 c7 \, U( a2 C - pyglossary test.ifo test.utf8 --write-format tabfile9 } l6 p* ]1 ^* c" o/ l. }
- 5 \ o8 X9 V- D" @9 x& ^* w7 K
- Interactive command-line interface:% V+ m4 Y' D% m) T
- Minimal command:3 `8 U7 u; p5 e, ?
- pyglossary --cmd
4 ^* {3 |1 e! ~8 [ j6 C - Or
# N& b4 z" Z1 W - pyglossary --ui=cmd, ~$ y8 B* s) G. S
- Additionally you can pass any flag to act to act as default9 q* u9 [5 @& n2 h2 B
- }) P% W- o& {* Z! Z- Y" m
! t8 [0 B9 M9 I) T2 k- q' j+ |- General Options:; ]4 }1 A/ D: q5 o3 Z8 h$ N$ \- H
- Verbosity:: x! [3 j' y( M& K
- -v0 or '--verbosity 0' for critical errors only
2 Z9 y) C8 r4 g7 r" u& b - -v1 or '--verbosity 1' for errors only
+ d% R$ j% a- P/ N% W6 { - -v2 or '--verbosity 2' for errors and warnings1 i0 n% S) \( H" u. }
- -v3 or '--verbosity 3' for errors, warnings and info4 h. K; v- j9 ~% Y& k$ J
- -v4 or '--verbosity 4' for debug mode
: [4 U0 f" P% D' s- T9 k1 Y* T- C - -v5 or '--verbosity 5' for trace mode# ^& q3 n5 k* I, D
- Appearance:8 W; k/ V) [; B
- --no-progress-bar and --no-color, useful for scripts1 F- }1 ~8 I" V& \4 \* M2 S
0 A! y6 h8 `3 d6 T; a- Full Convert Usage:! c- C! _8 P% _7 Z
- pyglossary INPUT_FILE OUTPUT_FILE [-vN] [--read-format=FORMAT] [--write-format=FORMAT]
6 c3 R, Z B T' ]3 a4 a - [--sort|--no-sort] [--direct|--indirect] [--no-alts] [--sort-cache-size=2000] [--utf8-check|--no-utf8-check]
. z/ X& [6 M$ C- E: @& e - [--lower|--no-lower] [--read-options=READ_OPTIONS] [--write-options=WRITE_OPTIONS]& A; F+ N3 y! g6 {6 F
- $ R/ t2 F; I. G, q
# k3 t" r/ {4 T0 I1 j* R- Q- Command line arguments and options (and arguments for options) is parsed with GNU getopt method
! h0 H& c, ?* e0 |' E - You can also just type extension of output file instead of full path, if you want to create with the same input1 _1 N2 a) A4 s
- file name with another extension. For example:3 z5 P; ?5 ]! y+ k& u
- pyglossary mydic.ifo txt
! z9 G0 V, F; T- T3 `$ g - instead of:
6 _. h4 O3 u; z7 R. m8 S2 y8 h - pyglossary mydic.ifo mydic.txt; _1 B7 U; g" C! F0 g1 {
- Compressing with gz, bz2 and zip is supported, just append these extension to the file name, for example:
W) A) v% W8 I, F7 ?& @% s - pyglossary mydic.ifo mydic.txt.gz
, _. ?! x# j+ V- z! e - or
' ]- \/ c5 O$ M+ g# o/ C - pyglossary mydic.ifo txt.gz) j; N! P% N; d' H7 e L, h1 o
- And if the input file has these extensions (gz, bz2, zip), it will be extracted before loading; R2 G& p% M6 V
复制代码 - I. Q/ n1 F# E' S
% K! D6 |- z$ D6 K
0 z$ R! R$ l9 Z2 n) ^6 z6 T/ M9 a0 Y* h Y7 W
/ O) k u3 J+ gApplications/Utilities/Dictionary Development Kit 下面* E+ a! F: W+ o, @7 I
- bin
" I% ?1 [; f, W. G - documents! ]5 b, f* k" K0 F
- project_templates
( U6 R2 ?! N2 m1 Z8 [ - samples
复制代码
* q/ N. q' ]( w- }, t
) k7 U/ k7 r# I4 ?; [( C
; [5 n: |# e6 b0 o4 @! v' y* \至今不知道问题出现在哪里? 麻烦各位了
% ^" \0 s* t+ B! Z4 f/ _: O
9 A! W1 F7 j( Y/ S5 W! I* N/ i3 g
* t) |" {! w1 }# c1 d3 N, }# u ~; t) C
9 [' D1 j2 ~# O/ l; P; q
|
|