예제 #1
0
파일: TP2.py 프로젝트: florussoFIUBA/tpSMN
def VerPronosticoAlertas(ubicacion, seleccion):
    '''Recibe una ubicación ingresada por el usuario.\n
    En caso de encontrar la ciudad en la base de datos, devuelve en pantalla el pronostico extendido para esa ciudad, y llama a la funcion de verAlertas con la provincia donde se encuentra la ciudad.\n
    PRE: Recibe una ciudad ingresada por el usuario
    '''
    listaUrl = ObtenerURL()
    chequeo = 0
    provincia = ""
    pronosticoAlertas = ""
    if (ubicacion == ""):
        ubicacion = RetornarLocalizacion(3)
    if (ubicacion != "Error al traer la ubicación actual"):
        ubicacion = ReemplazarAcentos(ubicacion.lower())
        for url in listaUrl:
            if (not isinstance(url, Exception)):
                for p in url:
                    if (ReemplazarAcentos(p["province"].lower()) == ubicacion
                            or ReemplazarAcentos(
                                p["name"].lower()) == ubicacion):
                        chequeo += 1
                        provincia = p["province"]
                        if (not seleccion):
                            pronosticoAlertas += f"Día {listaUrl.index(url)+1}\nTemperatura a la mañana: {p['weather']['morning_temp']}°C - Clima a la mañana: {p['weather']['morning_desc']}\nTemperatura a la tarde: {p['weather']['afternoon_temp']}°C - Clima a la tarde: {p['weather']['afternoon_desc']}\nZona: {p['name']}\n"
            else:
                messagebox.showerror("Error", ex)
        if (chequeo == 0):
            pronosticoAlertas += "La ciudad ingresada no se encuentra en la base de datos o no hay pronósticos. Intente nuevamente."
        if (provincia == ""):
            MostrarAlertas(ubicacion, pronosticoAlertas, False)
        else:
            MostrarAlertas(provincia, pronosticoAlertas, False)
    else:
        messagebox.show(ubicacion)
        def genbill():
            if cust_nm.get() == "" or (cust_con.get() == ""
                                       or len(cust_con.get()) != 10):
                messagebox.show("Error",
                                "Please entre all the fields correctly.")
            else:

                self.bill_txt.insert(END, f"\nCustomer Name : {cust_nm.get()}")
                self.bill_txt.insert(END,
                                     f"\ncustomer Contact : {cust_con.get()}")
                self.bill_txt.insert(END, f"\n Date : {date_pr.get()}")
                self.bill_txt.insert(
                    END,
                    "\n=========================================================================="
                )
                self.bill_txt.insert(
                    END,
                    "   \n Product Nmae\t\t         Quantity\t\t         Per Cost\t\t         Total"
                )
                self.bill_txt.insert(
                    END,
                    "\n=========================================================================="
                )
                self.add_btn.config(state="normal")
                self.total_btn.config(state="normal")
def insert():
    medicine_name=medicine_name.get()
    mg=mg.get()
    timings=timings.get()
    entry.delete(0,END)
    entry1.delete(0,END)
    entry2.delete(0,END)
    conn=sqlite3.connection("Health_Monitoring.db")
    cur=conn.cursor()
    cur.execute('INSERT INTO prescription (pid,tablet_mg,timing) VALUE(medicine_name,mg,timings) WHERE pid=id1')
    cur.commit()
    messagebox.show("Inserted the record successfully.")
예제 #4
0
파일: gui.py 프로젝트: nahmiasd/NaiveBayes
def Classify():
    global cls, path, title
    # if model not yet trained...
    if not isinstance(cls, NaiveBayes) or path == "":
        msg.showerror(title, "Model not built yet")
        return
    try:
        df = pd.read_csv(path + "\\test.csv")  # read the test set
        res = cls.classify(df)  # classify
        saveResults(res)  # save results
        msg.showinfo(
            title, "Classification process finished. results saved at: " +
            path + "/output.txt")
    except Exception as e:
        msg.show(title, "Test file is invalid")
예제 #5
0
def openNewWindow():
    messagebox.show("Fudendo mãe do Sisun", "Fudendo mãe do sisun")
예제 #6
0
        img = cv2.imread(a, 0)
        img = cv2.resize(img, (28, 28))
        img_res = img.reshape(-1, 28, 28, 1)
        img = img_res.astype("float32")
        img_new = img_res / 255.0
        s = model.predict_classes(img_new)[0]
        la.config(text=f"Predicted output of the image is : {s}",
                  font=("ariel", 25, 'bold'),
                  fg="white",
                  bg="steel blue")

    def exit():
        if messagebox.askyesno("ask", "do you want to quit?"):
            root.destroy()
except:
    messagebox.show("error", "there is something wrong")

la = Label(frame3, bg="steel blue")
la.place(x=130, y=20)

label5 = Label(frame1)
label5.place(x=0, y=0)

btn0 = Button(frame,
              text="Upload Image Here",
              font=("ariel", 14),
              command=upload)
btn0.place(x=300, y=340)

btn1 = Button(frame2,
              text="Predict",