from pprint import pprint as pp from see import see import numpy as np
If you haven't already, make sure to set your PYTHONSTARTUP environment variable to point to ~/.pythonstartup.
However, I use IPython as my python shell. Prior to IPython 0.11, you can get IPython to use your .pythonstartup by adding the following two lines to your ~/.ipython/ipythonrc:execute import os execute execfile(os.environ['PYTHONSTARTUP'])You may have noticed this nonstandard see module. see is an awesome alternative to python's built-in dir function, which I highly recommend.
from threading import Thread from functools import wraps def thread(func): @wraps(func) def wrap(*args, **kwargs): t = Thread(target=func, args=args, kwargs=kwargs) t.start() return t return wrapCareful though. If any callbacks access global or class variables, you may start running into synchronization issues. In certain situations, python's synchronized queue class can help. Otherwise, RLocks can be helpful.