• Adding timeout to sys.stdin.read(1)

    MicroPython uart read data telnet select
    3
    0 Votes
    3 Posts
    66 Views
    B
    @jcaron unfortunately, there is any method with the stdin and I haven't found any way to interact directly with the telnet server. My previous implementation used the UART, but then I realized that I was able to read from Telnet, but no way to type anything. Also, the telnet connection was quite slow and unreliable for some reason (time out when login/password). With stdin it works much better, but not typing anything will block the application forever.
  • File write and read

    MicroPython open file write data read data
    3
    0 Votes
    3 Posts
    1k Views
    robert-hhR
    @priis In the first example you forgot to close the file. The with clause in the second example is doing that for you. So no need to close there. P.S.: When you enclose your code in lines with three backticks (```), then it is printed as such.