Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7414597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:07:57+00:00 2026-05-29T07:07:57+00:00

How to redirect Mathematica printing and error printing to files? Sometimes, a Mathematica program

  • 0

How to redirect Mathematica printing and error printing to files?

Sometimes, a Mathematica program

  • 1) uses Print[] to print messages,
  • 2) sometimes, there is side-effect type of printing by some functions without any explicit Print[]
  • 3) and sometimes there is error printing.

How to redirect the above three varieties of printing to (separate) text files, so they can be archived (separately) when the Mathematica kernel is closed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:07:58+00:00Added an answer on May 29, 2026 at 7:07 am

    Print[] by default outputs to the stream $Output. Messages go to the $Messages stream. You can redefine these two global variables to redirect the output to a file:

    stream = OpenWrite["out.txt", FormatType -> OutputForm]
    $Output = {stream}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is possible to redirect the output of one program to the input of
I have a program which during it's run sometimes needs to call python in
Duplicate Redirect console output to textbox in separate program Capturing nslookup shell output with
How can i redirect to a different page along with passing some POST parameters
I am planning to redirect a url, which type of redirect is fastest? Meta
I redirect the user to the login page when user click log out however
To redirect (and append) stdout and stderr to a file, while also displaying it
I'm trying to redirect all requests to my domain to another domain using mod_rewrite
How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly)
I'd like to redirect the stdout of process proc1 to two processes proc2 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.