forked from geekcomputers/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f81c30
commit ed2c710
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import bs4 as bs | ||
from urllib import request | ||
from win10toast import ToastNotifier | ||
|
||
toaster = ToastNotifier() | ||
|
||
url = 'http://www.cricbuzz.com/cricket-match/live-scores' | ||
|
||
sauce = request.urlopen(url).read() | ||
soup = bs.BeautifulSoup(sauce,"lxml") | ||
#print(soup) | ||
score = [] | ||
results = [] | ||
#for live_matches in soup.find_all('div',attrs={"class":"cb-mtch-lst cb-col cb-col-100 cb-tms-itm"}): | ||
for div_tags in soup.find_all('div', attrs={"class": "cb-lv-scrs-col text-black"}): | ||
score.append(div_tags.text) | ||
for result in soup.find_all('div', attrs={"class": "cb-lv-scrs-col cb-text-complete"}): | ||
results.append(result.text) | ||
|
||
|
||
print(score[0],results[0]) | ||
toaster.show_toast(title=score[0],msg=results[0],icon_path='cricket.ico') | ||
|
||
#---------------------Completed to Requirement---------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import win32com.client as wincl | ||
from tkinter import * | ||
|
||
|
||
def text2Speech(): | ||
text = e.get() | ||
speak = wincl.Dispatch("SAPI.SpVoice") | ||
speak.Speak(text) | ||
|
||
|
||
#window configs | ||
tts = Tk() | ||
tts.wm_title("Text to Speech") | ||
tts.geometry("225x105") | ||
tts.config(background="#708090") | ||
|
||
|
||
f=Frame(tts,height=280,width=500,bg="#bebebe") | ||
f.grid(row=0,column=0,padx=10,pady=5) | ||
lbl=Label(f,text="Enter your Text here : ") | ||
lbl.grid(row=1,column=0,padx=10,pady=2) | ||
e=Entry(f,width=30) | ||
e.grid(row=2,column=0,padx=10,pady=2) | ||
btn=Button(f,text="Speak",command=text2Speech) | ||
btn.grid(row=3,column=0,padx=20,pady=10) | ||
tts.mainloop() | ||
|
||
|
||
|