write julia consolle output in a text file

2,272 views
Skip to first unread message

Michela Di Lullo

unread,
Jan 29, 2016, 11:19:20 AM1/29/16
to julia-users
How do I write the julia consolle output in a txt file? 

Thanks 

Michela

Tomas Lycken

unread,
Jan 29, 2016, 12:01:19 PM1/29/16
to julia-users
For example

open("log.txt", "w") do f
write(f," Hello, text file!")
end

or

julia your-script.jl > log.txt

depending on how you invoke your Julia code and what you mean by "console output".

// T

SundaraRaman R

unread,
Jan 30, 2016, 11:22:35 AM1/30/16
to julia-users
I'm interpreting "julia console" to mean the Julia REPL, in which case this recent thread seems to be asking the same question: https://groups.google.com/forum/#!topic/julia-users/gVyNkJT6ej0 and has two decent suggestions on how to do it.

Or, depending on your exact needs, you can always use Jupyter instead of the command-line REPL, and save the notebook to the disk.
Reply all
Reply to author
Forward
0 new messages