Tuesday, January 24, 2012

Fun with vim and IPython kernel

#First of all, get the development version of ipython

cd /home/philip/Packages
git clone https://github.com/ipython/ipython.git


# install this into your own virtualenv (I'm assuming at this point that you have created a virtualenv and that you have activated it).

pip install /home/philip/Packages/ipython

# do a 'which ipython' to check that it worked


# you will need development libraries for zeromq
sudo apt-get install libzmq-dev
pip install pyzmq

# check pyzmq was installed into the virtualenv

(py26)philip@desktop:~/git/project$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on desktop
Type "help", "copyright", "credits" or "license" for more information.
>>> import zmq
>>> zmq.__path__
['/home/philip/git/project/py26/lib/python2.6/site-packages/zmq']


# get the vim-ipython plugin
pip install git+https://github.com/ivanov/vim-ipython.git


# start up an IPython kernel.
 ipython kernel

# and you get output like:
(py26)philip@desktop:~/git/project$ ipython kernel
[IPKernelApp] To connect another client to this kernel, use:
[IPKernelApp] --existing kernel-32459.json


# startup vim and connect to the ipython kernel
gvim -c "IPython --existing kernel-32459.json"

or startup gvim and enter
:IPython --existing kernel-32459.json

In vim add this line:
3 + 4
Hit ctrl-s while still on this line and notice that a new window opens up with the result from the ipython kernel

now enter
a = 1

# from another shell
ipython qtconsole --existing kernel-32459.json

# to start up a qtconsole and connect it to the kernel
pip install pyside
ipython qtconsole --existing kernel-32459.json

do:
print a

And notice that the result of a is 1 because that is what we set a to from our vim session.


1 comment:

Unknown said...

Your Affiliate Profit Machine is ready -

And getting it set up is as easy as 1..2..3!

This is how it all works...

STEP 1. Input into the system what affiliate products the system will advertise
STEP 2. Add PUSH BUTTON traffic (this ONLY takes 2 minutes)
STEP 3. Watch the affiliate products system explode your list and up-sell your affiliate products all by itself!

So, do you want to start making profits?

The solution is right here