0.0.90
This commit is contained in:
parent
37fe0bf7c7
commit
3406ea8abd
@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.0.89
|
version = 0.0.90
|
||||||
author = guanjihuan
|
author = guanjihuan
|
||||||
author_email = guanjihuan@163.com
|
author_email = guanjihuan@163.com
|
||||||
description = An open source python package
|
description = An open source python package
|
||||||
|
@ -321,7 +321,7 @@ 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.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_translation=1, show_link=1, translation_time=2, rest_time=1)
|
guan.play_academic_words(reverse=0, random_on=0, bre_or_ame='ame', show_translation=1, show_link=1, translation_time=2, rest_time=1)
|
||||||
|
|
||||||
guan.play_element_words(random_on=0, show_translation=1, show_link=1, translation_time=2, rest_time=1)
|
guan.play_element_words(random_on=0, show_translation=1, show_link=1, translation_time=2, rest_time=1)
|
||||||
|
|
||||||
@ -2334,7 +2334,7 @@ def pdf_to_audio(pdf_path, rate=125, voice=1, read=1, save=0, print_text=0):
|
|||||||
engine.say(text)
|
engine.say(text)
|
||||||
engine.runAndWait()
|
engine.runAndWait()
|
||||||
|
|
||||||
def play_academic_words(bre_or_ame='ame', random_on=0, show_translation=1, show_link=1, translation_time=2, rest_time=1):
|
def play_academic_words(reverse=0, random_on=0, bre_or_ame='ame', show_translation=1, show_link=1, translation_time=2, rest_time=1):
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import re
|
import re
|
||||||
import urllib.request
|
import urllib.request
|
||||||
@ -2358,6 +2358,8 @@ def play_academic_words(bre_or_ame='ame', random_on=0, show_translation=1, show_
|
|||||||
contents = re.findall('<h2>.*?</a></p>', html, re.S)
|
contents = re.findall('<h2>.*?</a></p>', html, re.S)
|
||||||
if random_on==1:
|
if random_on==1:
|
||||||
random.shuffle(contents)
|
random.shuffle(contents)
|
||||||
|
if reverse==1:
|
||||||
|
contents.reverse()
|
||||||
for content in contents:
|
for content in contents:
|
||||||
soup2 = BeautifulSoup(content, features='lxml')
|
soup2 = BeautifulSoup(content, features='lxml')
|
||||||
all_h2 = soup2.find_all('h2')
|
all_h2 = soup2.find_all('h2')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user