Use the "input" function - it waits until the user type enter (it can type more text before pressing enter, but if you are not going to do anything with this text, it is indifferent):
input("Pressione <enter> para continuar")
The os.system("pause")
runs another entire program - and means that the "Pause" program has to exist on your operating system, and it is something just from Windows: your Python program (or C) that would work on Linux, Mac, Android, becomes "windows only" just because of it.
But above all, using the`system("pause"), even in C, is equivalent in programming, to calling a winch to take your car somewhere, with you inside, because the car is out of gas, instead of filling up.
The "input" function, on the other hand, is internal to Python, it doesn’t even need to import any module - and it only depends on the interaction of the Python Framework itself with the standard input of the program. (In C the correct would be to use the function fgets
).
system("pause");
is not a "C command" - it uses a system shell call to run another integer PROGRAM - which is Pause. (The same works in Python, as given in the answer) - but is equivalent to calling a keychain to break down your door every time you want to enter the house, instead of fixing the lock.– jsbueno