Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python, cx_freeze and Windows console

I'm using cx_freeze to make an executable for Windows.

It works fine, but when i type in all my variables i get the calculated V value and then the console application closes right after.

What i need is pretty trivial: a name of a command or function that will hold console open after the last value is calculated.

Please, give a hint if you know.

   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
like image 900
gdmka Avatar asked Dec 11 '25 12:12

gdmka


1 Answers

End it with

raw_input("press enter to close.")
like image 190
thebjorn Avatar answered Dec 14 '25 02:12

thebjorn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!