I am using Julia in Atom. I have a for loop which prints out information in each iteration. I want Julia to pause the program at the end of each iteration so that it only continues to the next iteration if a certain key is pressed (for instance, say the 'enter' key) in the REPL. How should I do this?
CodePudding user response:
The following should work (in REPL as well) :
for i in 1:3
# ...
println("something")
readline() # wait for enter key press
end
Using readline()
captures keystrokes (which you can assign to a variable to actually read them) until you press enter.