Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーが Enter や Escape (両方ではない) などの特定のキーを押すのを待ち、キーの押下を感知した後にさらにコードを実行する簡単な方法を知りたいです。
試す:
raw_input('Press enter to continue: ')
または、Python 3 では:
input('Press enter to continue: ')
使うだけ
raw_input('Press Enter')
メッセージが出力され、Enter キーが押されるのを待ちます。