Can I export command line & result from iPython PyRosetta shell to a text file?

Member Site Forums PyRosetta PyRosetta – General Can I export command line & result from iPython PyRosetta shell to a text file?

Viewing 1 reply thread
  • Author
    • #1978

        Dear Sir or Madam,
        I know we can use cmd.exe to export command line by using

        python > name.txt

        However, we cannot see anything in the cmd.exe if we do that.

        I am thinking can we export result from iPython to a text file? I was trying

        run > name.txt

        But I think the file of “name.txt” has not been created.

        Can you please help me? Thank you very much.

      • #10234

          You may have more luck asking on a python or ipython specific forum, as the syntax to do so generally wouldn’t be PyRosetta specific.

          One complication you may have is that the C++ layer of PyRosetta goes through a different output path than the Python-level output does. By default, PyRosetta is set up to direct the output through the logging module of Python (, if applicable, rather than just sys.stdout. See and for details on how to use the logging module. You need to set up the logger to redirect the output to the appropriate locations prior to calling rosetta.init()

          If you want logging to go to both a file and the terminal, see for an example. This wouldn’t capture any python-level output you make, though (unless you also output it through a logger), and wouldn’t maintain a copy of the commands you typed.

        • #10235

            Hi rmoretti,
            Many thanks for your help indeed. But it seems to be quite technical to me. I will try to understand it slowly.

            Yours sincerely

        Viewing 1 reply thread
        • You must be logged in to reply to this topic.