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.

Executing JShell commands from within notebook

See original GitHub issue

We are evaluating the use of the IJava kernel as part of an introductory course on (Java) programming. It looks very promising, esp. because it nicely integrates with nbgrader. We wondered how one would execute JShell commands from within a notebook, like /vars? Via magics?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
padreaticommented, Oct 11, 2019

@mrcalvin A comment related with %open magic: there is already a %load magic which loads and executes a given notebook. I use this approach to set up a notebook for bootstrap my library and I suppose it is quite useful.

1reaction
mrcalvincommented, Oct 11, 2019

Thanks for the informative reply (tool vs. API)! In fact, when cross-reading the doc on available jshell commands and the API doc, I think an immediately useful starting point would be introspection commands (as they map 1:1 to JShell methods):

  • %vars: variables
  • %types: types
  • %methods: methods
  • %imports: imports

I wondered whether a variant of %open would also be nice, to pick up snippets from a script relative to a given notebook (like a cross-notebook startup script)? This could be used to stage a certain, shared environment of methods and variables, for different students to start working from common grounds. Also, sth. like %save would be nice, to collect all evaluated snippets into a dump script (to maybe re-process them independently from the Jupyter notebook environment).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Executing terminal commands in Jupyter notebook
Might be useful for others. Use ! followed by terminal command you want to execute. To run a shell command. E.g., ! pip...
Read more >
IPython and Shell Commands | Python Data Science Handbook
IPython bridges this gap, and gives you a syntax for executing shell commands directly from within the IPython terminal. The magic happens with...
Read more >
Shell commands in IPython - Jupyter Tutorial 0.9.0
The IPython Notebook allows simple UNIX/Linux commands to be executed in a single input cell. There are no limits but when using, please...
Read more >
Running Shell Commands in Jupyter Notebook - YouTube
This video demonstrates how to run shell commands in jupyter notebook itself.
Read more >
Running Shell Commands Inside Jupyter Notebook - YouTube
... execute shell command in jupyter notebook, run shell script in jupyter notebook, shell commands, linux commands, running shell commands ...
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