diff --git a/API_Reference/API_Reference.py b/API_Reference/API_Reference.py index ff26bf1..8c6b52a 100644 --- a/API_Reference/API_Reference.py +++ b/API_Reference/API_Reference.py @@ -263,4 +263,4 @@ content = guan.pdf_to_text(pdf_path) guan.pdf_to_audio(pdf_path, rate=125, voice=1, read=1, save=0, print_text=0) -guan.play_academic_words(bre_or_ame='ame', random_on=0, show_chinese=1, show_link=1, chinese_time=2, rest_time=1) \ No newline at end of file +guan.play_academic_words(bre_or_ame='ame', random_on=0, show_translation=1, show_link=1, translation_time=2, rest_time=1) \ No newline at end of file diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index 89c8f3e..c0afce1 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.0.63 +version = 0.0.64 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan/__init__.py b/PyPI/src/guan/__init__.py index 0300ad5..f007aa7 100644 --- a/PyPI/src/guan/__init__.py +++ b/PyPI/src/guan/__init__.py @@ -1703,7 +1703,7 @@ def pdf_to_audio(pdf_path, rate=125, voice=1, read=1, save=0, print_text=0): engine.say(text) engine.runAndWait() -def play_academic_words(bre_or_ame='ame', random_on=0, show_chinese=1, show_link=1, chinese_time=2, rest_time=1): +def play_academic_words(bre_or_ame='ame', random_on=0, show_translation=1, show_link=1, translation_time=2, rest_time=1): from bs4 import BeautifulSoup import re import urllib.request @@ -1751,10 +1751,10 @@ def play_academic_words(bre_or_ame='ame', random_on=0, show_chinese=1, show_link track = pygame.mixer.music.load(directory+word+'.mp3') pygame.mixer.music.play() translation = re.findall('

.*?

', content, re.S)[0][3:-4] - time.sleep(chinese_time) - if show_chinese==1: + if show_translation==1: + time.sleep(translation_time) print(translation) - time.sleep(rest_time) + time.sleep(rest_time) pygame.mixer.music.stop() except: pass