question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to continue serial connection after flashing: stdin / stdout in terminal mode with REPL on CTRL-C

See original GitHub issue

Update:

There might be a way to run “Flash /path/to/your/file.py” run configurations in the terminal window and continue by offering you full REPL provided via microrepl.py. We have something like that for regular Python run configurations in PyCharm. There is an option when you edit a Python run configuration: “Emulate terminal in the output console”.

Original issue:

I added this little snippet at the end of the main() function in microupload.py to aid debugging:

while True:
    line = board.serial.readline()
    sys.stdout.buffer.write(line)
    sys.stdout.buffer.flush()

In intelliJ this plugin is also ignoring the “excluded files”, so it tries to flash 48 files where only three are sources. It would be helpful if the plugin would use the sources root as the base for microupload.py instead of the project root.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
thinkbergcommented, Jun 6, 2020

Please do. I am totally with you regarding the issues with that solution. Feel free to take what is useful and change what may be solved better.

0reactions
mytechnotalentcommented, Apr 15, 2022

There is no way to output any print('hello') capabilities when you use the run main.py. Any workaround?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Option to continue serial connection after flashing: stdin ...
I've just tried it with your snippet and it does indeed help you with seeing any your program produced for the terminal. At...
Read more >
Using stdout, stdin, and stderr in Node.js - LogRocket Blog
Learn about the standard streams including stdout, stdin, and stderr and how they can help you build programs in your Node.js application.
Read more >
terminal.txt - Vim
Use :execute if you must have a Vim command following in the same line. A new buffer will be created, using [command] or...
Read more >
Documentation - iTerm2 - macOS Terminal Replacement
iTerm2 is a replacement for Terminal and the successor to iTerm.
Read more >
How to check if stdin/stdout are connected to a terminal in tcl
I've got bad news. I've checked the code, and the Windows console channel type handler doesn't declare any custom options (unlike on ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found