Пример #1
0
 def refresh_stats(self):
     ret = scrape_data()
     if ret is None:
         messagebox.showerror('no internet', 'No internet connection')
     else:
         read_stats_file()
         self.get_world_info()
Пример #2
0
def download_csv():
    print('Fetching data from internet .....')
    ret = scrape_data()
    if ret is None:
        root.withdraw()
        messagebox.showerror('no internet',
                             'Connect with internet \nand run the app again')
        sys.exit(0)
Пример #3
0
                                   font=("times new roman", 15, "bold"),
                                   bg="white",
                                   fg="white",
                                   bd=5,
                                   relief=tk.GROOVE)
        self.graph.config(width=260, height=400)
        self.graph.grid(row=2, column=1, columnspan=5, padx=10)


if __name__ == '__main__':
    root = tk.Tk()
    root.geometry('750x550')
    root.wm_title('Covid Tracker By Amadou-python3')

    if not os.path.exists('corona-cases.csv'):
        print('Fetching data from internet .....')
        ret = scrape_data()
        if ret is None:
            root.withdraw()
            messagebox.showerror(
                'no internet', 'Connect with internet \nand run the app again')
            sys.exit(0)

    from covid_analyser import get_world, top10, get_country, read_stats_file
    from covid_visualizer import get_plot

    virus = PhotoImage(file='virus.gif')

    app = Application(master=root)
    app.mainloop()