Show More
@@ -808,17 +808,17 b' class OSMagics(Magics):' | |||||
808 | This magic command can either take a local filename, an url, |
|
808 | This magic command can either take a local filename, an url, | |
809 | an history range (see %history) or a macro as argument :: |
|
809 | an history range (see %history) or a macro as argument :: | |
810 |
|
810 | |||
|
811 | If no parameter is given, prints out history of current session up to | |||
|
812 | this point. | |||
|
813 | ||||
811 | %pycat myscript.py |
|
814 | %pycat myscript.py | |
812 | %pycat 7-27 |
|
815 | %pycat 7-27 | |
813 | %pycat myMacro |
|
816 | %pycat myMacro | |
814 | %pycat http://www.example.com/myscript.py |
|
817 | %pycat http://www.example.com/myscript.py | |
815 | """ |
|
818 | """ | |
816 | if not parameter_s: |
|
819 | try: | |
817 | raise UsageError('Missing filename, URL, input history range, ' |
|
820 | cont = self.shell.find_user_code(parameter_s, | |
818 | 'or macro.') |
|
821 | skip_encoding_cookie=False) | |
819 |
|
||||
820 | try : |
|
|||
821 | cont = self.shell.find_user_code(parameter_s, skip_encoding_cookie=False) |
|
|||
822 | except (ValueError, IOError): |
|
822 | except (ValueError, IOError): | |
823 | print("Error: no such file, variable, URL, history range or macro") |
|
823 | print("Error: no such file, variable, URL, history range or macro") | |
824 | return |
|
824 | return |
General Comments 0
You need to be logged in to leave comments.
Login now