omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Long-press run does not clear console

    Pythonista
    3
    6
    4345
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Olaf
      Olaf last edited by Olaf

      Both in Pythonista2 and Pythonista3 (latest betas) a long press to run (i.e. with args in 2; either with args or doctest in 3) does not clear the console if clear output before running is set in settings. I don't know whether this is by design, but (especially with verbose option; great option BTW) the doctest output tends to get longish, so this behaviour may lead to confusing output

      1 Reply Last reply Reply Quote 1
      • omz
        omz last edited by

        This should be fixed in the latest P3 beta (forgot to mention in the release notes).

        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          Btw, I've also removed the "verbose" option for doctest output. The new UI shows doctest results directly in the editor, which is better than both of the old output modes, I think.

          1 Reply Last reply Reply Quote 0
          • Olaf
            Olaf last edited by

            Great! Also the PEP8.

            Although run with args clears the console now, doctest still doesn't, although that's merely inconsistent, not an issue, now doctest flags its outcomes in the source file.

            Also, doctest fails mysteriously on

            with open('test.txt', 'w') as f:
                pass
            

            with

            PermissionError: [Errno 1] Operation not permitted: 'test.txt'
            
            1 Reply Last reply Reply Quote 0
            • dgelessus
              dgelessus last edited by

              @Olaf When running doctests the initial directory is the Pythonista app bundle. Try running this as a doctest and you'll see:

              """
              >>> import os
              >>> os.getcwd()
              """
              
              1 Reply Last reply Reply Quote 0
              • Olaf
                Olaf last edited by

                @dgelessus thanks, mystery solved
                This applies both inside and outside triple quotes

                In long-press run doctest, the cwd differs differs from

                import doctest
                doctest.testmod()
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors