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.
ユーザーに raw_input を与える方法はありますが、""x 時間以内に何も入力されない場合は null 応答 () を返しますか? スクリプトの開始時にオプションを入力するためにユーザーに 10 秒を与えたいのですが、時間が経過した (または Enter キーを押した) 場合は、単にスクリプトを続行します。AppleScriptに詳しい方display dialog "Enter options" giving up after 10、pythonでお願いします
""
display dialog "Enter options" giving up after 10
UNIXランドにいる場合は、Pythonのシグナルライブラリを使用して、アラームを使用できます。そうでなければ、私raw_inputは完全にスレッドブロッキングだと思います。
raw_input
実装のヘルプについては、この回答を参照してください。