> From: chris Hynes <cjhyne...@hotmail.com> > Date: 2009/7/15 > Subject: The why > To: roadier...@googlemail.com > > > Well, I'm trying to create an interactive program, let's say I'm > running the program, I ask the user to give the array a name, I then > do some computations and store the results in that array. While I'm > still running the program I might decide to create several more arrays > of the same type/dimension with names of my choosing same types of > computation. When I'm done, I might have several arrays created, all > with different names that I have given them. In the ipython mode I > could call up any of these arrays off and on again as I want to > visually compare them to each other.
You could write your program as a library with functions that create your arrays. For example in myfuncs.py put: def make_zeros(): return zeros((3,3)) Then in ipython: from myfuncs import * # usually import * is discouraged but this is a reasonable use chris = make_zeros() bob = make_zeros() etc. Kent Please Reply All to reply to the list. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor