Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
7553d6d6
Commit
7553d6d6
authored
Mar 07, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add doc note on how to use Cython from IPython notebook
parent
3d6f0126
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
docs/src/quickstart/build.rst
docs/src/quickstart/build.rst
+32
-0
No files found.
docs/src/quickstart/build.rst
View file @
7553d6d6
...
...
@@ -46,6 +46,38 @@ start a Python session and do ``from hello import say_hello_to`` and
use the imported function as you see fit.
Using the IPython notebook
--------------------------
Cython can be used conveniently and interactively from a web browser
through the IPython notebook. To install IPython, e.g. into a virtualenv,
use pip:
.. sourcecode:: bash
(venv)$ pip install "ipython[notebook]"
(venv)$ ipython notebook
To enable support for Cython compilation, install Cython and load the
``cythonmagic`` extension from within IPython::
%load_ext cythonmagic
Then, prefix a cell with the ``%%cython`` marker to compile it::
%%cython
cdef int a = 0
for i in range(10):
a += i
print a
You can show Cython's code analysis by passing the ``--annotate`` option::
%%cython --annotate
...
Using the Sage notebook
-----------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment