File: ipy_profile_numpy.py

package info (click to toggle)
ipython 0.13.1-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,752 kB
  • sloc: python: 69,537; makefile: 355; lisp: 272; sh: 80; objc: 37
file content (24 lines) | stat: -rw-r--r-- 524 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
""" IPython 'numpy' profile, to preload NumPy.

This profile loads the math/cmath modules as well as all of numpy.

It exposes numpy via the 'np' shorthand as well for convenience.
"""

from IPython.core import ipapi
import ipy_defaults

def main():
    ip = ipapi.get()

    try:
        ip.ex("import math,cmath")
        ip.ex("import numpy")
        ip.ex("import numpy as np")

        ip.ex("from numpy import *")

    except ImportError:
        print "Unable to start NumPy profile, is numpy installed?"
    
main()