Last active
February 13, 2018 13:41
-
-
Save armancohan/efc54cd8b269d9cdcfdfbd217d8401df to your computer and use it in GitHub Desktop.
Example ipython startup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add this to ~/.ipython/profile_default/startup/start.py | |
| import os | |
| import sys | |
| import re | |
| from collections import Counter, defaultdict, namedtuple | |
| import itertools | |
| import json | |
| import numpy as np | |
| import gzip | |
| import pandas as pd | |
| import pickle | |
| import random | |
| import types | |
| def imports(): | |
| for _, val in globals().items(): | |
| if isinstance(val, types.ModuleType): | |
| yield val.__name__ | |
| print('successfully imported: [{:s}]'.format( | |
| ', '.join(sorted(set( | |
| ['"{:s}"'.format(e) | |
| for e in imports() | |
| if '__' not in e and 'types' not in e]))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment