En esta ocasión se trae la Viscosidad del Agua, la
interfaz cuenta con 4 correlaciones que
permiten la obtención de Mw, A continuación se muestra el código
completo:
from tkinter import *
import tkinter as tk
from tkinter import ttk
import numpy as np
from tkinter import messagebox
Ventana.geometry("300x300")
Ventana.maxsize(300,300)
Ventana.minsize(300,300)
Ventana.title("Viscosidad del
Agua")
Ventana.configure(background="gray80",highlightbackground="gray80",highlightcolor="black")
Recuadro_Entradas.place(relx=0.01,
rely=0.01, relheight=0.40, relwidth=0.980)
Recuadro_Entradas.configure(relief='groove',foreground="black",text='''Entradas''',background="gray80",highlightbackground="gray80",highlightcolor="black",width=330)
Mensaje_1.place(relx=0.01, rely=0.05,
height=25, width=50)
Mensaje_1.configure(background="gray80",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center',text='''P''')
Mensaje_2 = tk.Message(Recuadro_Entradas)
Mensaje_2.place(relx=0.01, rely=0.38,
height=25, width=50)
Mensaje_2.configure(background="gray80",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center',text='''T''')
Mensaje_3 = tk.Message(Recuadro_Entradas)
Mensaje_3.place(relx=0.01, rely=0.71,
height=25, width=50)
Mensaje_3.configure(background="gray80",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center',text='''S''')
Entrada_1.place(relx=0.2, rely=0.05,
height=20, width=80)
Entrada_1.configure(background="white",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center')
Entrada_2 = tk.Entry(Recuadro_Entradas)
Entrada_2.place(relx=0.2, rely=0.39,
height=20, width=80)
Entrada_2.configure(background="white",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center')
Entrada_3 = tk.Entry(Recuadro_Entradas)
Entrada_3.place(relx=0.2, rely=0.72,
height=20, width=80)
Entrada_3.configure(background="white",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center')
Entrada_2.delete(0,tk.END);Entrada_2.insert(tk.END,"");Entrada_2.insert(tk.END,0.00)
Entrada_3.delete(0,tk.END);Entrada_3.insert(tk.END,"");Entrada_3.insert(tk.END,0.00)
Recuadro_Correlaciones.place(relx=0.01,
rely=0.44, relheight=0.20, relwidth=0.980)
Recuadro_Correlaciones.configure(relief='groove',foreground="black",text='''Correlaciones
Disponibles''',background="gray80",highlightbackground="gray80",highlightcolor="black",width=330)
Visor_correlaciones =
ttk.Combobox(Recuadro_Correlaciones)
Visor_correlaciones.place(relx=0.02,
rely=0.40, height=25, width=280, bordermode='ignore')
Visor_correlaciones.configure(takefocus="",state="readonly",textvariable
= Variable, justify = "center",values = Valores)
Visor_correlaciones.current(0)
P
= 5000 # psi
T
= 200 #°F
"""
P
= float(Entrada_1.get()) # psi
T
= float(Entrada_2.get()) # °S
S
= float(Entrada_3.get()) # psi
B
= 70.634+0.09576*(S**2)
B
=
-1.12166+2.63951*(10**-2)*S-6.79461*(10**-4)*(S**2)-5.47119*(10**-5)*(S**3)+1.55586*(10**-6)*(S**4)
except
ZeroDivisionError:
Recuadro_Salidas.place(relx=0.01, rely=0.67,
relheight=0.20, relwidth=0.980)
Recuadro_Salidas.configure(relief='groove',foreground="black",text='''Salidas''',background="gray80",highlightbackground="gray80",highlightcolor="black",width=330)
Mensaje_4.place(relx=0.10, rely=0.20,
height=25, width=80)
Mensaje_4.configure(background="gray80",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='left',text='''Mw''')
Mensaje_9 = tk.Label(Recuadro_Salidas)
Mensaje_9.place(relx = 0.69, rely = 0.20,
height=25, width=50)
Mensaje_9.configure(background="gray80",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center',text='''cp''')
Salida_1 = tk.Entry(Recuadro_Salidas)
Salida_1.place(relx=0.35, rely=0.21,
height=20, width=80)
Salida_1.configure(background="white",foreground="#000000",highlightbackground="#d9d9d9",highlightcolor="black",justify='center')
Entrada_2.delete(0,tk.END);Entrada_2.insert(tk.END,"");Entrada_2.insert(tk.END,0.00)
Entrada_3.delete(0,tk.END);Entrada_3.insert(tk.END,"");Entrada_3.insert(tk.END,0.00)
Salida_1.delete(0,tk.END);Salida_1.insert(tk.END,"");Salida_1.insert(tk.END,0.00)

No hay comentarios.:
Publicar un comentario