improve style
This commit is contained in:
+7
-4
@@ -9,6 +9,8 @@ Usage: python3 dict.sh [word]
|
|||||||
HAS_RICH = 0
|
HAS_RICH = 0
|
||||||
try:
|
try:
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
|
from rich.panel import Panel
|
||||||
|
from rich.text import Text
|
||||||
HAS_RICH = 1
|
HAS_RICH = 1
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@@ -44,7 +46,7 @@ def rich_paring(data):
|
|||||||
ponetic = data["phonetic"]
|
ponetic = data["phonetic"]
|
||||||
samples = data["sample_sentence"]
|
samples = data["sample_sentence"]
|
||||||
|
|
||||||
console.print(word, style="bold purple")
|
console.print(word, style="bold magenta")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
if len(ponetic.items()) > 0:
|
if len(ponetic.items()) > 0:
|
||||||
@@ -61,9 +63,10 @@ def rich_paring(data):
|
|||||||
|
|
||||||
for s in samples[:2]:
|
for s in samples[:2]:
|
||||||
ens = s['en'].replace('"', '\"')
|
ens = s['en'].replace('"', '\"')
|
||||||
console.print("-", end=" ", style="rgb(154,91,2)")
|
panel = Panel(Text(ens, style="rgb(12,122,108)", justify="left"))
|
||||||
console.print(ens, style="rgb(165,38,28)")
|
|
||||||
print()
|
#console.print(ens, style="rgb(165,38,28)")
|
||||||
|
console.print(panel)
|
||||||
#console.print(s['cn'], style="rgb(13,245,86)")
|
#console.print(s['cn'], style="rgb(13,245,86)")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user