gpt4 book ai didi

Python、cx_freeze 和 Windows 控制台

转载 作者:太空宇宙 更新时间:2023-11-03 15:23:50 24 4
gpt4 key购买 nike

我正在使用 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.")

关于Python、cx_freeze 和 Windows 控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10361344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com