I have a large Mathematica notebook that uses Print[]
commands periodically to output runtime messages. This is the only output (aside from exported files) that this notebook generates. Is there any way I can automate the export of this output to a .txt file without having to re-write the Print[]
commands?
相关问题
- Puzzled by Function body evaluation
- Lazily Reading a File in D
- how to overload Times and Plus for matrix multipli
- AOSP Build TARGET_PRODUCT fails
- DirectoryStream.Filter example for listing files t
相关文章
- How to replace file-access references for a module
- Why is file_get_contents faster than memcache_get?
- Transactionally writing files in Node.js
- histogram without vertical lines in Mathematica
- Getting the cluster size of a hard drive (through
- Example for file read/write with NSFileHandle
- line-by-line file processing, for-loop vs with
- How to store output of a stored procedure on to di
You want the PutAppend command.
According to the documentation,
Print
outputs to the$Output
channel which is a list of streams. So, at the beginning of the notebook,and at the end of the notebook
Note, if execution is interrupted prior to closing the stream, then you'll have to do it manually. Also, the above code will overwrite prior data in "output.log," so you may wish to use
OpenAppend
, instead.Edit: to guarantee that
Abort
will be called, consider using one of the techniques outlined here.