【发布时间】:2017-02-18 16:37:30
【问题描述】:
我真的需要帮助,我编写了一个实现流量方程的脚本。问题是我很想把它转换成 GUI,我是一名学生,我打算很快提交这个作业,我现在没有时间学习 Tkinter,但我肯定会在下个月学习它。下面的脚本:
print ("this program measures gas flowrate in pipes with effect of elevation, making use of USCS unit")
e=2.718
Tb=520
Pb=14.7
f=float(input("Friction factor,f: "))
P1=float(input("upstream pressure,P1: "))
P2=float(input("downstream pressure,P2: "))
G=float(input("gas gravity,G: "))
Tf=float(input("average gas flowing temperature,Tf: "))
L=float(input("pipe line segment,L: "))
Z=float(input("gas compressibility factor at flowing temperature,Z: "))
D=float(input("pipe inside diameter,D: "))
H1=float(input("upstream elevation,H1: "))
H2=float(input("downstream elevation,H2: "))
s=float((0.0375*G)*((H2-H1)/(Tf*Z)))
j=float((e**s-1)/s)
Le=float(L*j)
F=float(2/f**0.5)
Q=38.77*F*(Tb/Pb)*((P1**2-(e**s*P2**2))/(G*Tf*Le*Z))**0.5*D**2.5
print(j);
print(s);
print(Q);
非常感谢您的帮助
【问题讨论】:
-
您希望拥有什么样的 GUI?输入输出?
-
听起来你可以使用EasyGUI。
-
那么,您是在要求我们为您做作业吗?这不是 stackoverflow 的用途。
-
i don't have time for learning Tkinter now but i will surely learn it next month这是学习编程课程(或大多数课程)的一种非常糟糕的方法。 -
谢谢大家。不是我不想学,我还是在努力每天学习python第一..