How to run script from interpreter?
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Thu May 29 20:33:08 EDT 2014
On Thu, 29 May 2014 15:26:37 -0500, Mark H Harris wrote:
> I think the IDLE REPL should have a system shell mode. What say you?
I don't use IDLE, so I don't really care what you do to it. But speaking
generally, -1 on that. IDLE is primarily aimed at beginners, and
beginners have enough trouble distinguishing the system shell separate in
their heads from the Python shell, the last thing they need is something
that blurs the difference.
There is a power-user shell that does exactly what you want, turned up to
eleven: IPython. IPython allows you to run system commands by prefixing
them with ! and has an entire subsystem of user-configurable "magic"
commands using % prefix.
(By the way, ; won't work for a Python shell, because ;spam already is
valid Python syntax: it's an empty statement followed by the statement
spam, separated by a semicolon.)
--
Steven D'Aprano
http://import-that.dreamwidth.org/
More information about the Python-list
mailing list