Mercurial > python-cmd2
comparison cmd2.py @ 274:540315f06a17
must use unparsed string for py
author | catherine@cordelia |
---|---|
date | Mon, 04 May 2009 11:42:06 -0400 |
parents | fd5197498667 |
children | f62e9fbb3f90 |
comparison
equal
deleted
inserted
replaced
273:fd5197498667 | 274:540315f06a17 |
---|---|
811 py <command>: Executes a Python command. | 811 py <command>: Executes a Python command. |
812 py: Enters interactive Python mode. | 812 py: Enters interactive Python mode. |
813 End with `Ctrl-D` (Unix) / `Ctrl-Z` (Windows), `quit()`, 'exit()`. | 813 End with `Ctrl-D` (Unix) / `Ctrl-Z` (Windows), `quit()`, 'exit()`. |
814 Non-python commands can be issued with `cmd("your command")`. | 814 Non-python commands can be issued with `cmd("your command")`. |
815 ''' | 815 ''' |
816 arg = arg.parsed.raw[2:].strip() | |
816 if arg.strip(): | 817 if arg.strip(): |
817 interp = InteractiveInterpreter(locals=self.pystate) | 818 interp = InteractiveInterpreter(locals=self.pystate) |
818 interp.runcode(arg) | 819 interp.runcode(arg) |
819 else: | 820 else: |
820 interp = MyInteractiveConsole(locals=self.pystate) | 821 interp = MyInteractiveConsole(locals=self.pystate) |