Categories
Python Answers

How to make a Python script wait for a pressed key?

Spread the love

Sometimes, we want to make a Python script wait for a pressed key.

In this article, we’ll look at how to make a Python script wait for a pressed key.

How to make a Python script wait for a pressed key?

To make a Python script wait for a pressed key, we can use the input function.

For instance, we write

input("Press Enter to continue...")

to call input with the prompt text to wait for the user to press enter before continuing the script.

Conclusion

To make a Python script wait for a pressed key, we can use the input function.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *