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.


    Carriage Returning?

    Pythonista
    2
    3
    1659
    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.
    • pypad
      pypad last edited by

      Got the app a few days ago and was amazed at how Beautiful Soup was a part of one of the libraries. Decided to import some code I was writing on my computer that downloads some stuff from a certain website, and when my program comes to a line to print out the status of something that's downloading, it keeps updating itself with each new line instead of on a single line like so on my laptop. Is this just a problem with the app itself, iOS, or my program? If it helps, the line is basically this:

      sys.stdout.write("\r ...%d%%, %d MB, %d KB/s, %d seconds have passed" %(percent, progress_size / (1024 * 1024), speed, duration))
      sys.stdout.flush()
      

      Other than that, this program's great and with my free time, I'm starting to play around with changing some of my programs to work with the UI stuff.

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

        Pythonista's console doesn't support using the carriage return like that. You can clear the current output like this however:

        import console
        console.clear()
        
        1 Reply Last reply Reply Quote 0
        • pypad
          pypad last edited by

          ah ok. Thanks!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors