0

I want my pong game that is made by turtle module to start when user press Enter key (python)

what I did is just add s to start but I cannot do enter key he should type enter as string word not key

ggorlen
  • 44,755
  • 7
  • 76
  • 106
  • Hi and welcome to SO! To get a good answer, pease improve for question. Maybe it is helpful to read https://stackoverflow.com/help/asking before asking ;) Please add some code: what did you try so far, etc. – droebi Nov 20 '22 at 07:30
  • https://codeigo.com/python/check-if-user-pressed-enter this blog can help – droebi Nov 20 '22 at 07:36

1 Answers1

0

As @droebi mentioned, I would advise you to slightly improve the question, as there are some mistakes that add slight difficulty to read your question.

But from what I inferred, you want the user to not press the enter key, but actually type the word enter in the console to start the program. This problem can be solved in two ways:

input("Type Enter to start:\n")
# your code

You can do this if you don't really care what the user is typing.

import sys
start = input("Type Enter to start:\n").lower()
if start == "enter":
  pass
else:
  sys.exit("You did not type Enter. Please type 'Enter' to start.")
# your code

You can do this if you want to be particular that the user SHOULD type enter.

In case you did want to start the program when the enter key is pressed, however, then you can take a look at the answers for this question.