These are chat archives for ipython/ipython

28th
Jul 2016
Keyvhinng
@keyvhinng
Jul 28 2016 04:57
hi, is there someone here?
Oleg Serbokryl
@Krokop
Jul 28 2016 06:54
hi, yep
Sylvain Corlay
@SylvainCorlay
Jul 28 2016 13:27
I have a quick question on ipython magics
is it possible to compute parts of the magics command in python and pass it as a variable?
...

specifically I would like to do

from pip import locations
include_dir = locations.distutils_scheme('foobar')['headers']

and then

%%cython --cplus -I[include_dir]
Min RK
@minrk
Jul 28 2016 13:36
Variable given as {name} should be expanded
%%cython --cplus -I{include_dir}
Sylvain Corlay
@SylvainCorlay
Jul 28 2016 13:46
thanks!
this works perfectly!