Dag Dag - 1 year ago 100
Python Question

is there a way to use input("Press any key to continue") on version 2.6

I want the program to paus, and wait until you press any key to continue, but raw_input() is going away, and input() is replacing it. So I have

var = input("Press enter to continue") and it waits until I press enter, but then it fails with SyntaxError: unexpected EOF while Parsing.
This works OK on a system with python 3, but this is linux pythin 2.6 I hate to have to code in raw_input() since it is going away.
Any suggestions?

Answer Source

Use this

    input= raw_input
except NameError:

If raw_input exists, it will be used for input. If it doesn't exist, input still exists.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download