3
我使用cx_freeze为Windows创建可执行文件。Python,cx_freeze和Windows控制台
它工作正常,但是当我输入所有我的变量时,我得到计算的V值,然后控制台应用程序关闭。
我需要的是非常简单:命令或函数的名称将在计算最后一个值后保持控制台打开状态。
请给出提示,如果你知道。
print "Caculate bullet speed measurement with the use of Ballistic Pendulum. Warning: only numbers are allowed!"
M = float(raw_input("enter M value: "))
R = float(raw_input("enter R value: "))
m = float(raw_input("enter m value: "))
l = float(raw_input("enter l value: "))
g = float(raw_input("enter g value: "))
s = float(raw_input("enter s value: "))
t = float(raw_input("enter t value: "))
n = float(raw_input("enter n value: "))
pi = 3.14
#we could use math.py module but a permanent value is fine
#or use division where one value is float e.g. 22.0/7
A = ((M * R + m * l) * g * s * t)
B = (2 * pi * n * m *(l ** 2))
print "V =", A/B
这很容易!谢谢。 – gdmka 2012-04-28 07:26:12
@gdmka:如果这个答案已经解决了你的问题,你应该点击左边的勾号来接受它。 – 2012-04-29 11:48:35