Replies: 3 comments 2 replies
-
|
Hi, I've asked your question to ChatGPT and after a lot of tries concerning stdin (=console) in Pythonista, it gave this code which is working. |
Beta Was this translation helpful? Give feedback.
-
|
I think try:
name = input("Enter your name: ")
except KeyboardInterrupt:
print("Interrupted")Press Ctrl+C to raise |
Beta Was this translation helpful? Give feedback.
-
|
@cvpe : I can't get that working in Pythonista, at least using some variant keyboard entry |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am doing a Harvard course on Python and they are using “except EOFError:” to terminate a program using a Ctrl+D.
Ctrl+D works fine on python on my PC and in visual studio browser environment (used by the Harvard course) but it doesn’t work in any combination that I can figure in Pythonista. I can see that the EOFError exception is supported.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions