Then we create stub file with the following code in our python module and a folder for our notebooks.Īnd we activate our virtualenv/Conda environment and run pip install -e. It makes sense to use virtualenv (or EPD/Anaconda environments) to isolate your system Python from your development packages.įirst we create Python project in P圜harm, add source folder with setup.py defining a basic python package. We could also accomplish this with some hacking on sys.path or PYTHONPATH, but having our code available as a package is a lot more seamless. This installs the package as it is pointing to our project directory and that we are always importing the code that we are editing.
We are going to organise our code in a Python package and install it with Pip using the -e or -editable option. Use the IPython autoreload extension to dynamically reload code.Install our code as an editable Pip package.
This cunning recipe consists of two spicy ingredients, Both are neat tricks on their own, but together they form a smooth workflow bridging exploratory programming and more structured software engineering. Regardless there are other very nice IDEs for Python such as Wing or Eclipse, and the approach here will work equally well with them. Further some functionality such as debugging appears to be plainly non-functional. You get the the completion and code navigation from P圜harm, but editing and navigation is reduced to half a dozen buttons. What about that? Personally I find that the IPython notebook integration in the latest P圜harm (version 4.0.6) still isn’t adequate for serious work. Hey, P圜harm already have IPython notebook integration. In this blog post I’m going to show how you can simultaneously work on code in both the IDE and IPython notebook or interactive shell while keeping the running notebook and IDE project in sync. Here at Comperio we use P圜harm a lot which has excellent code editing, semantic completion, a graphical debugger and efficient code navigaton capabilities. In many academic environments and increasingly in industry IPython notebooks are used for data visualisation work and exploratory programming, depending on the IPython interactive environment for fast prototyping of ideas.Īs nice an environment we have in IPython, I often wish for the features of a full-fledged IDE. They are a reasonably good environment for interactive computing, can contain inline data visualisations and can be hosted remotely for sharing results or working together with other developers. IPython notebooks have become an indispensable tool for many Python developers.