I am very new to python.. I used the code
x = input(\" Hey what is your name \" )
print(\" Hey, \" + x)
input(\" press close to exit \")
That can be done with os module. Following is the simple code :
import os
os.system("pause")
This will generate a pause and will ask user to press any key to continue.
[edit: The above method works well for windows os. It seems to give problem with mac (as pointed by ihue, in comments). The thing is that "os" library is operating system specific and some commands might not work with one operating system like they work in another one.]