-
A line must start with a magic in order to be interpreted as a magic.
-
Magics can be nested within a line
-
Magics can return any object they like (but it should be JSON-dumpable)
-
If no valid magic is found, the block will be considered code and handled by the kernel.
-
Help magic is special:
- It can be at the end of the line and takes precedence.
- No code is executed when a help magic is present.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Jupyter Development Team. | |
// Distributed under the terms of the Modified BSD License. | |
/** | |
* A bunch of predefined `Simple Actions` used by Jupyter. | |
* `Simple Actions` have the following keys: | |
* help (optional): a short string the describe the action. | |
* will be used in various context, like as menu name, tool tips on buttons, | |
* and short description in help menu. | |
* help_index (optional): a string used to sort action in help menu. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================= test session starts ============================= | |
platform win32 -- Python 2.7.7 -- py-1.4.20 -- pytest-2.5.2 | |
collected 1032 items | |
jedi/__init__.py . | |
jedi/api/__init__.py . | |
jedi/api/classes.py ..F.. | |
jedi/api/replstartup.py . | |
jedi/evaluate/docstrings.py .. | |
jedi/evaluate/finder.py .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
PLUGINS = ['jedi', 'rope', 'fallback'] | |
def get_introspection(plugin, task): | |
# TODO: make this a QThread | |
name, source_code, offset, filename = task | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Completions should be case-sensitive | |
There are three potential objects: | |
- the token we are in the middle of | |
- partial version of that token | |
- the prior token representing a function call | |
For completions, use the partial object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2 id="installation">Installation</h2> | |
<p>You need to download <a href="https://github.com/gpeyre/numerical-tours/archive/master.zip">numerical_tours</a> and install the IPython <a href="http://ipython.org/install.html">notebook</a> to run the code.</p> | |
<p>You must also install the <a href="http://arokem.github.io/python-matlab-bridge/">python-matlab-bridge</a>.</p> | |
<p>Make sure you can run the command <code>matlab</code> from a command window (or terminal). If not, try the methods below:</p> | |
<p><strong>Unix-like-systems (including OSX):</strong></p> | |
<p>Add the following to your <code>~/.profile</code>:</p> | |
<p><code>export PATH="$PATH:<PATH_TO_MATLAB>"</code></p> | |
<p><strong>Windows systems:</strong></p> | |
<p>From a CMD window:</p> | |
<p><code>> setx PATH "%PATH%;C:\PATH_TO_MATLAB.EXE"</code></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import optparse | |
import shlex | |
import ast | |
def split_args(cmd): | |
args = shlex.split(cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
import re | |
import threading | |
import Queue | |
import sys | |
import signal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import check_output | |
import os | |
from metakernel import ProcessMetaKernel, REPLWrapper, u | |
class OctaveKernel(ProcessMetaKernel): | |
# Identifiers: | |
implementation = 'octave_metakernel' | |
language = 'octave' |
OlderNewer