11
$\begingroup$

Something weird just happened to me: I mis-typed a keyboard shortcut, hitting the wrong keys, and a new notebook opened up with a Python prompt! Just for grins, I tried entering some simple Python code into the cell and evaluating it, and sure enough, it produced correct output.

enter image description here

The little python-logo box to the left of the input box, if clicked, produces a drop-down menu that lets me choose Python or NodeJS.

I've done some googling, and discovered that Mathematica has a new experimental "external evaluation system". Cool! However, I have been unable to figure out what keystroke I hit that made this little gem appear. All the Mathematica docs say is that one can use the relatively clumsy ExternalEvaluate["Python",code] expression.

Does anyone know how to produce this special input cell?

$\endgroup$
1
  • 1
    $\begingroup$ Type > at the start of an input cell $\endgroup$
    – Carl Woll
    Commented Oct 15, 2019 at 2:15

1 Answer 1

12
$\begingroup$

Type > at the start of a cell (or when between cells). This is documented in an example on ref/ExternalEvaluate (last Basic Example). I'm a bit suprised it's not in the details section. It probably should be...

$\endgroup$
1
  • $\begingroup$ Argh. I guess I should have scrubbed through the examples more carefully… I assumed to quickly that because it is an "experimental" feature, the keyboard shortcut would be undocumented. $\endgroup$
    – ibeatty
    Commented Oct 15, 2019 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.