sys.stdout.write appends size to output

  • I'm using the latest firmware on a GPy. Here's a simple example of sys.stdout.write:

    PYB: soft reboot
    Pycom MicroPython 1.20.2.rc6 [v1.11-01f49f7] on 2020-02-28; GPy with ESP32
    Type "help()" for more information.
    >>> import sys
    >>> s = "fred"
    >>> sys.stdout.write(s)
    >>> s = "fred, wilma, barney and betty"
    >>> sys.stdout.write(s)
    fred, wilma, barney and betty29

    It really looks like it's appending the size of the written buffer to the output. Is that a bug or is that intended?


  • Nevermind, just figured out that the length is the return value and it's printed out immediately after in the repl. Sorry, nothing to see here...


Log in to reply

Pycom on Twitter