gdmka
gdmka

Reputation: 31

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

Upvotes: 3

Views: 818

Answers (1)

thebjorn
thebjorn

Reputation: 27311

End it with

raw_input("press enter to close.")

Upvotes: 4

Related Questions