[英]Python, cx_freeze and Windows console
我正在使用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
结束它
raw_input("press enter to close.")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.