Show More
@@ -1,7 +1,7 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """Magic functions for InteractiveShell. |
|
2 | """Magic functions for InteractiveShell. | |
3 |
|
3 | |||
4 |
$Id: Magic.py 109 |
|
4 | $Id: Magic.py 1092 2006-01-27 23:56:32Z vivainio $""" | |
5 |
|
5 | |||
6 | #***************************************************************************** |
|
6 | #***************************************************************************** | |
7 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and |
|
7 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and | |
@@ -2860,7 +2860,10 b' Defaulting color scheme to \'NoColor\'"""' | |||||
2860 | else: |
|
2860 | else: | |
2861 | self.user_ns[par] = block |
|
2861 | self.user_ns[par] = block | |
2862 | print "Block assigned to '%s'" % par |
|
2862 | print "Block assigned to '%s'" % par | |
2863 |
|
2863 | def magic_quickref(self,arg): | ||
|
2864 | import IPython.usage | |||
|
2865 | page(IPython.usage.quick_reference) | |||
|
2866 | del IPython.usage | |||
2864 |
|
2867 | |||
2865 |
|
2868 | |||
2866 | # end Magic |
|
2869 | # end Magic |
@@ -6,7 +6,7 b' Requires Python 2.1 or better.' | |||||
6 |
|
6 | |||
7 | This file contains the main make_IPython() starter function. |
|
7 | This file contains the main make_IPython() starter function. | |
8 |
|
8 | |||
9 |
$Id: ipmaker.py 10 |
|
9 | $Id: ipmaker.py 1092 2006-01-27 23:56:32Z vivainio $""" | |
10 |
|
10 | |||
11 | #***************************************************************************** |
|
11 | #***************************************************************************** | |
12 | # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu> |
|
12 | # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu> | |
@@ -405,6 +405,7 b" object? -> Details about 'object'. ?object also works, ?? prints more." | |||||
405 |
|
405 | |||
406 | # 'profiles' are a shorthand notation for config filenames |
|
406 | # 'profiles' are a shorthand notation for config filenames | |
407 | if opts_all.profile: |
|
407 | if opts_all.profile: | |
|
408 | ||||
408 | try: |
|
409 | try: | |
409 | opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile |
|
410 | opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile | |
410 | + rc_suffix, |
|
411 | + rc_suffix, | |
@@ -605,11 +606,19 b" object? -> Details about 'object'. ?object also works, ?? prints more." | |||||
605 | # finally, try importing ipy_*_conf for final configuration |
|
606 | # finally, try importing ipy_*_conf for final configuration | |
606 | try: |
|
607 | try: | |
607 | import ipy_system_conf |
|
608 | import ipy_system_conf | |
608 | import ipy_user_conf |
|
|||
609 |
|
||||
610 | except ImportError: |
|
609 | except ImportError: | |
|
610 | warn("Could not import 'ipy_system_conf'") | |||
611 | pass |
|
611 | pass | |
612 | #IP.InteractiveTB() XXX uncomment in a later release |
|
612 | if opts_all.profile: | |
|
613 | profmodname = 'ipy_profile_' + opts_all.profile | |||
|
614 | try: | |||
|
615 | __import__(profmodname) | |||
|
616 | except ImportError: | |||
|
617 | warn("Could not import '%s'" % profmodname) | |||
|
618 | try: | |||
|
619 | import ipy_user_conf | |||
|
620 | except ImportError: | |||
|
621 | warn('Could not import ipy_user_conf') | |||
613 |
|
622 | |||
614 | # release stdout and stderr and save config log into a global summary |
|
623 | # release stdout and stderr and save config log into a global summary | |
615 | msg.config.release_all() |
|
624 | msg.config.release_all() |
@@ -6,7 +6,7 b'' | |||||
6 | # the file COPYING, distributed as part of this software. |
|
6 | # the file COPYING, distributed as part of this software. | |
7 | #***************************************************************************** |
|
7 | #***************************************************************************** | |
8 |
|
8 | |||
9 |
# $Id: usage.py |
|
9 | # $Id: usage.py 1092 2006-01-27 23:56:32Z vivainio $ | |
10 |
|
10 | |||
11 | from IPython import Release |
|
11 | from IPython import Release | |
12 | __author__ = '%s <%s>' % Release.authors['Fernando'] |
|
12 | __author__ = '%s <%s>' % Release.authors['Fernando'] | |
@@ -597,3 +597,44 b' MAIN FEATURES' | |||||
597 | won't work: |
|
597 | won't work: | |
598 | >>> x = ,my_function /home/me # syntax error |
|
598 | >>> x = ,my_function /home/me # syntax error | |
599 | """ |
|
599 | """ | |
|
600 | ||||
|
601 | quick_reference = r""" | |||
|
602 | IPython -- An enhanced Interactive Python - Quick Reference Card | |||
|
603 | ================================================================ | |||
|
604 | ||||
|
605 | obj?, obj??, ?obj,??obj : Get help, or more help for object | |||
|
606 | ?os.p* : List names in os starting with p | |||
|
607 | ||||
|
608 | Example magic: | |||
|
609 | ||||
|
610 | %alias d ls -F : 'd' is now an alias for 'ls -F' | |||
|
611 | alias d ls -F : Works if 'alias' not a python name | |||
|
612 | alist = %alias : Get list of aliases to 'alist' | |||
|
613 | ||||
|
614 | System commands: | |||
|
615 | ||||
|
616 | !cp a.txt b/ : System command escape, calls os.system() | |||
|
617 | cp a.txt b/ : after %rehash, most system commands work without ! | |||
|
618 | cp ${f}.txt $bar : Variable expansion in magics and system commands | |||
|
619 | files = ls /usr : Capture sytem command output | |||
|
620 | files.s, files.l, files.n: "a b c", ['a','b','c'], 'a\nb\nc' | |||
|
621 | cd /usr/share : Obvious, also 'cd d:\home\_ipython' works | |||
|
622 | ||||
|
623 | History: | |||
|
624 | ||||
|
625 | _i, _ii, _iii : Previous, next previous, next next previous input | |||
|
626 | _ih[4], _ih[2:5] : Input history line 4, lines 2-4 | |||
|
627 | _, __, ___ : previous, next previous, next next previous output | |||
|
628 | _dh : Directory history | |||
|
629 | _oh : Output history | |||
|
630 | %hist : Command history | |||
|
631 | ||||
|
632 | Autocall: | |||
|
633 | ||||
|
634 | f 1 2 : f(1,2) | |||
|
635 | ,f 1 2 : f("1","2") | |||
|
636 | ;f 1 2 : f("1 2") | |||
|
637 | ||||
|
638 | """ | |||
|
639 | ||||
|
640 |
@@ -22,6 +22,10 b'' | |||||
22 | %store foo >> ~/myfoo.txt to store variables to files (in clean |
|
22 | %store foo >> ~/myfoo.txt to store variables to files (in clean | |
23 | textual form, not a restorable pickle). |
|
23 | textual form, not a restorable pickle). | |
24 |
|
24 | |||
|
25 | * ipmaker.py: now import ipy_profile_PROFILENAME automatically | |||
|
26 | ||||
|
27 | * usage.py, Magic.py: added %quickref | |||
|
28 | ||||
25 | 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu> |
|
29 | 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu> | |
26 |
|
30 | |||
27 | * IPython/demo.py (Demo.show): Flush stdout after each block, so |
|
31 | * IPython/demo.py (Demo.show): Flush stdout after each block, so |
General Comments 0
You need to be logged in to leave comments.
Login now