Show More
@@ -0,0 +1,18 b'' | |||
|
1 | import ipy_defaults | |
|
2 | # import ... | |
|
3 | # Load Numpy an SciPy by themselves so that 'help' works on them | |
|
4 | ||
|
5 | import IPython.ipapi | |
|
6 | import ipy_defaults | |
|
7 | ||
|
8 | def main(): | |
|
9 | ip = IPython.ipapi.get() | |
|
10 | ||
|
11 | ip.ex("import scipy") | |
|
12 | ip.ex("import numpy") | |
|
13 | ||
|
14 | ip.ex("from scipy import *") | |
|
15 | ip.ex("from numpy import *") | |
|
16 | ||
|
17 | if __name__ == "__main__": | |
|
18 | main() No newline at end of file |
@@ -1,84 +1,84 b'' | |||
|
1 | 1 | #!python |
|
2 | 2 | """Windows-specific part of the installation""" |
|
3 | 3 | |
|
4 | 4 | import os, sys, shutil |
|
5 | 5 | |
|
6 | 6 | def mkshortcut(target,description,link_file,*args,**kw): |
|
7 | 7 | """make a shortcut if it doesn't exist, and register its creation""" |
|
8 | 8 | |
|
9 | 9 | create_shortcut(target, description, link_file,*args,**kw) |
|
10 | 10 | file_created(link_file) |
|
11 | 11 | |
|
12 | 12 | def install(): |
|
13 | 13 | """Routine to be run by the win32 installer with the -install switch.""" |
|
14 | 14 | |
|
15 | 15 | from IPython.Release import version |
|
16 | 16 | |
|
17 | 17 | # Get some system constants |
|
18 | 18 | prefix = sys.prefix |
|
19 | 19 | python = prefix + r'\python.exe' |
|
20 | 20 | # Lookup path to common startmenu ... |
|
21 | 21 | ip_dir = get_special_folder_path('CSIDL_COMMON_PROGRAMS') + r'\IPython' |
|
22 | 22 | |
|
23 | 23 | # Some usability warnings at installation time. I don't want them at the |
|
24 | 24 | # top-level, so they don't appear if the user is uninstalling. |
|
25 | 25 | try: |
|
26 | 26 | import ctypes |
|
27 | 27 | except ImportError: |
|
28 | 28 | print ('To take full advantage of IPython, you need ctypes from:\n' |
|
29 | 29 | 'http://sourceforge.net/projects/ctypes') |
|
30 | 30 | |
|
31 | 31 | try: |
|
32 | 32 | import win32con |
|
33 | 33 | except ImportError: |
|
34 | 34 | print ('To take full advantage of IPython, you need pywin32 from:\n' |
|
35 | 35 | 'http://starship.python.net/crew/mhammond/win32/Downloads.html') |
|
36 | 36 | |
|
37 | 37 | try: |
|
38 | 38 | import readline |
|
39 | 39 | except ImportError: |
|
40 | 40 | print ('To take full advantage of IPython, you need readline from:\n' |
|
41 | 41 | 'http://sourceforge.net/projects/uncpythontools') |
|
42 | 42 | |
|
43 | 43 | # Create IPython entry ... |
|
44 | 44 | if not os.path.isdir(ip_dir): |
|
45 | 45 | os.mkdir(ip_dir) |
|
46 | 46 | directory_created(ip_dir) |
|
47 | 47 | |
|
48 | 48 | # Create program shortcuts ... |
|
49 | 49 | f = ip_dir + r'\IPython.lnk' |
|
50 | 50 | a = prefix + r'\scripts\ipython' |
|
51 | 51 | mkshortcut(python,'IPython',f,a) |
|
52 | 52 | |
|
53 | 53 | f = ip_dir + r'\pysh.lnk' |
|
54 | 54 | a = prefix + r'\scripts\ipython -p sh' |
|
55 | 55 | mkshortcut(python,'IPython command prompt mode',f,a) |
|
56 | 56 | |
|
57 | 57 | f = ip_dir + r'\scipy.lnk' |
|
58 |
a = prefix + r'\scripts\ipython -pylab -p sci |
|
|
58 | a = prefix + r'\scripts\ipython -pylab -p sci' | |
|
59 | 59 | mkshortcut(python,'IPython scipy profile',f,a) |
|
60 | 60 | |
|
61 | 61 | # Create documentation shortcuts ... |
|
62 | 62 | t = prefix + r'\share\doc\ipython-%s\manual.pdf' % version |
|
63 | 63 | f = ip_dir + r'\Manual in PDF.lnk' |
|
64 | 64 | mkshortcut(t,r'IPython Manual - PDF-Format',f) |
|
65 | 65 | |
|
66 | 66 | t = prefix + r'\share\doc\ipython-%s\manual\manual.html' % version |
|
67 | 67 | f = ip_dir + r'\Manual in HTML.lnk' |
|
68 | 68 | mkshortcut(t,'IPython Manual - HTML-Format',f) |
|
69 | 69 | |
|
70 | 70 | # make ipython.py |
|
71 | 71 | shutil.copy(prefix + r'\scripts\ipython', prefix + r'\scripts\ipython.py') |
|
72 | 72 | |
|
73 | 73 | def remove(): |
|
74 | 74 | """Routine to be run by the win32 installer with the -remove switch.""" |
|
75 | 75 | pass |
|
76 | 76 | |
|
77 | 77 | # main() |
|
78 | 78 | if len(sys.argv) > 1: |
|
79 | 79 | if sys.argv[1] == '-install': |
|
80 | 80 | install() |
|
81 | 81 | elif sys.argv[1] == '-remove': |
|
82 | 82 | remove() |
|
83 | 83 | else: |
|
84 | 84 | print "Script was called with option %s" % sys.argv[1] |
General Comments 0
You need to be logged in to leave comments.
Login now