Skip to content

Instantly share code, notes, and snippets.

@armancohan
Last active February 13, 2018 13:41
Show Gist options
  • Select an option

  • Save armancohan/efc54cd8b269d9cdcfdfbd217d8401df to your computer and use it in GitHub Desktop.

Select an option

Save armancohan/efc54cd8b269d9cdcfdfbd217d8401df to your computer and use it in GitHub Desktop.
Example ipython startup script
# 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