2012-04-28 78 views
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 

回答

4

結束它

raw_input("press enter to close.") 
+0

這很容易!謝謝。 – gdmka 2012-04-28 07:26:12

+4

@gdmka:如果這個答案已經解決了你的問題,你應該點擊左邊的勾號來接受它。 – 2012-04-29 11:48:35