Open johanrosenkilde opened 7 years ago
Thanks for report. I think it is possible to implement such a command for any magic function.
You can now use %%cython
when evaluating regions or buffers. But it seems that %%cython
must be at the top line of the region or the buffer. Otherwise it will raise an error. It may be a bug of get_ipython().run_cell
or %%cython
.
For example, evaluating the following code with C-c C-c
raises an error. Without the first statement, it works fine.
a = 1
%%cython
def f(double x):
return x * x + x
The following also works fine.
%%cython
def f(double x):
return x * x + x
a = 1
By the way, you can also use other magic functions.
This is a great addition - thanks!
I can't get
sage-shell-mode
to accept %cython magic markers. The same code that copy-paste works in the IPython Sage shell gives the following error whenC-c C-r
'ing the code inside Emacs:Is there any way to make %%cython work?