Python'da aşağıdakine benzer bir betik olması mümkün mü? Bir python komut dosyasında komut girişini duraklatıp bekletme
...
Pause
->
Wait for the user to execute some commands in the terminal (e.g.
to print the value of a variable, to import a library, or whatever).
The script will keep waiting if the user does not input anything.
->
Continue execution of the remaining part of the script
Esasen komut geçici piton komut satırı yorumlayıcısı kontrolü verir ve kullanıcı nasılsa o kısmı tamamlandıktan sonra devam.
Düzenleme: (cevap esinlenerek) ile gelip ne aşağıdaki gibi bir şey:
x = 1
i_cmd = 1
while True:
s = raw_input('Input [{0:d}] '.format(i_cmd))
i_cmd += 1
n = len(s)
if n > 0 and s.lower() == 'break'[0:n]:
break
exec(s)
print 'x = ', x
print 'I am out of the loop.'
Bu soru bir * REPL * ([Read-Eval-Print-Loop] (https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) soruyor.) . [Benzer bir soru] (http://stackoverflow.com/questions/1395913/how-to-drop-into-repl-read-eval-print-loop-from-python-code) ile ilgili birkaç öneri bulunmaktadır. code.InteractiveInterpreter() 've' pdb'. – Possum