def run(self): global x global games global game url = "http://www.sportsnet.ca/baseball/mlb/scores/" while True: games = MLB.main(url) for game in games: time.sleep(5) #print "over with thread" self.emit(QtCore.SIGNAL("ThreadDone()"))
def run(self): global x global games global game url ="http://www.sportsnet.ca/baseball/mlb/scores/" while True: games = MLB.main(url) for game in games: time.sleep(5) #print "over with thread" self.emit(QtCore.SIGNAL("ThreadDone()"))
__author__ = 'user0' import sys import MLB from threading import Thread try: #python 2 import Tkinter as tk from Tkinter import messagebox except ImportError: #python 3 import tkinter as tk from tkinter import messagebox url ="http://www.sportsnet.ca/baseball/mlb/scores/" url2= "http://www.sportsnet.ca/baseball/mlb/scores/?datepicker-date=2015-08-11" #date picker Games = MLB.main(url) def on_closing(): if messagebox.askokcancel("Quit", "Do you want to quit?"): root.destroy() sys.exit() def callback(Game): root.protocol("WM_DELETE_WINDOW", on_closing) text.insert("1.0",Game[4] + "\n") text.insert("2.0",Game[0] + " " + Game[1] + "\n") text.insert("3.0",Game[2] + " " + Game[3] + "\n") root = tk.Tk() #width --> width in chars, height --> lines of text text_width = 20 text = tk.Text(root,width=text_width, height =3, bg ='yellow') text.pack()
def getPicks(): print(MLB.run()) return 'Picks Completed'
def getPicks(): try: NBA.run() except: print('NBA failed to run') try: MLB.run() except: print('MLB failed to run') try: ELO.run() except: print('ELO failed to run') try: NHL.run() except: print('NHL failed to run') try: NFL.run() except: print('NFL failed to run') try: EPL.run() except: print('EPL failed to run') try: GPL.run() except: print('GPL failed to run') try: FL1.run() except: print('FL1 failed to run') try: TSL.run() except: print('TSL failed to run') try: ISA.run() except: print('ISA failed to run') try: LLA.run() except: print('LLA failed to run') try: NPL.run() except: print('NPL failed to run') try: PPL.run() except: print('PPL failed to run') try: ECL.run() except: print('ECL failed to run') try: MLM.run() except: print('MLM failed to run') try: UCL.run() except: print('UCL failed to run') try: DSL.run() except: print('DSL failed to run') try: EUL.run() except: print('EUL failed to run') try: LLT.run() except: print('LLT failed to run') try: AAL.run() except: print('AAL failed to run') try: FDS.run() except: print('FDS failed to run') try: MMA.run() except: print('MMA failed to run') return 'Picks Completed'
def getPicks(): try: NBA.run() except: print('No NBA yet') try: MLB.run() except: print('No MLB yet') try: NHL.run() except: print('No NHL yet') try: NFL.run() except: print('No NFL yet') try: ELO.run() except: print("No ELO yet") try: EPL.run() except: print('No EPL yet') try: GPL.run() except: print('No GPL yet') try: FL1.run() except: print('No FL1 yet') try: TSL.run() except: print('No TSL yet') try: ISA.run() except: print('No ISA yet') try: LLA.run() except: print('No LLA yet') try: NPL.run() except: print('No NPL yet') try: PPL.run() except: print('No PPL yet') try: ECL.run() except: print('No ECL yet') try: MLM.run() except: print('No MLM yet') try: UCL.run() except: print('No UCL yet') try: DSL.run() except: print('No DSL yet') try: EUL.run() except: print('No EUL yet') try: LLT.run() except: print('No LLT yet') try: AAL.run() except: print('No AAL yet') try: FDA.run() except: print('No FDA yet') try: BPL.run() except: print('No BPL yet') try: MMA.run() except: print('No MMA yet') return 'Picks Completed'