try: input("Press enter to continue ...") except SyntaxError: pass How do I make python to wait for a pressed key