Skip to content
All Posts

Automatically Import Modules When IPython Starts

A simple IPython startup-script setup that makes frequently used modules available in every interactive session.

Create a script under ~/.ipython/profile_default/startup/. The filename is up to you; for example, start.py. Import frequently used packages in that script, and IPython will load them every time it starts instead of making you import them manually when needed.

import os
import sys
import time
import json
import requests
import logging
import base64
from datetime import datetime, date
from pprint import pprint as pp

There are several other useful IPython features. I will summarize those another time—I’ve been a little too lazy lately.


Originally published on SegmentFault.