Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better output for cell magics #31

Open
Josverl opened this issue Jan 24, 2024 · 0 comments
Open

better output for cell magics #31

Josverl opened this issue Jan 24, 2024 · 0 comments

Comments

@Josverl
Copy link
Owner

Josverl commented Jan 24, 2024

normal cells show the eval of the last (non-blank) line
(its complicated to do so , but it allows for simple use)

the %%micropython cell magic does not do this

# %%micropython
msg = "Hello World"
msg

implementation option :

  • take the last line
  • check if we can eval that in Cpython ( or use the ipython methods for that ?)
  • ( if syntax error ) then execute the entire cell as normal ( not beatiful, but effective )
  • otherwise
    • remove the last line
    • run the first part of the cell ( if any)
    • eval the last line : mpremote resume eval "msg"
      combine the results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant