[SciPy-user] Namespace Questions

Fernando Perez scipy-user@scipy.net
Thu, 20 Feb 2003 10:31:26 -0700 (MST)


On 19 Feb 2003, Bill Alexander wrote:

> Chalk these up to the "I want it like Matlab" category...  My apologies
> for the length.
> 
> What I'd like to do is invoke scripting commands from an interactive
> python session from the global namespace.  In Matlab, all m-file scripts
> are members of and operate within the invoking namespace, whereas
> functions create a private interior namespace for operation.  I want to
> be able to mimic the no-namespace-change scripts of Matlab from within
> the Python interactive shell.

You may also want to look at ipython 
(http://www-hep.colorado.edu/~fperez/ipython/).  Its @run command is 
essentially a fancy wrapper around execfile(), with all sorts of options to 
control namespaces, access to the debugger and the profiler, etc.  It was 
designed specifically with interactive scientific computing in mind, so you 
may find it useful.

Cheers,

f