私はこれに対する答えを探して長い間閲覧してきました。
Unix で Python 2.7 を使用しています。
連続するwhileループがあり、ユーザーがそれを中断して何かを実行すると、その後ループが続行されるオプションが必要です。
お気に入り:
while 2 > 1:
for items in hello:
if "world" in items:
print "hello"
else:
print "world"
time.sleep(5)
here user could interrupt the loop with pressing "u" etc. and modify elements inside he loop.
raw_input でテストを開始しましたが、サイクルごとにプロンプトが表示されるため、必要のないものです。
ここに記載されている方法を試しました:
数回、しかし、どれも私が望むようには機能していないようです。