[Python-Dev] Criticism of execfile() removal in Python3 (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Tue Jun 17 00:39:29 CEST 2014


On 17 Jun 2014 03:42, "Chris Barker" <chris.barker at noaa.gov> wrote:

On Sat, Jun 14, 2014 at 1:11 PM, Paul Sokolovsky <pmiscml at gmail.com> wrote:

> > 1. It hampers interactive mode - instead of short and easy to type > > execfile("file.py") one needs to use exec(open("file.py").read()). > > If the amount of typing is the problem, that's easy to solve: > > # do this once > def execfile(name): > exec(open("file.py").read()) FWIW, when I started using python (15?) years ago -- the first thing I looked for was a way to "just run a file", at the interactive prompt, like I had in MATLAB. I found and used execfile().

Yes, if people are looking for a MATLAB replacement, they want IPython rather than the default REPL.

The default one is deliberately minimal, IPython is designed to be a comprehensive numeric and scientific workspace.

Cheers, Nick. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140617/9ae8e097/attachment.html>



More information about the Python-Dev mailing list