2009/7/15 chris Hynes <cjhyne...@hotmail.com>: > I guess I have to start somewhere to ask............ > > I want the user to input a name, say "Chris". I know I can use the code: > > name=raw_input() > > I now want: > > "Chris"=zeros((3,3)) > > so that when I type: > > print Chris > > the return will be an array of zero's 3x3 > > So that I can understand this deeper, I know that "name" is just a pointer > to the object "Chris". I don't want to just change the pointer to something > else, like "zeros((3,3))" but I want to make "Chris" become the pointer or > the name of the pointer. At least that's what I think I want. > > ________________________________ > Windows Live™ SkyDrive™: Get 25 GB of free online storage. Get it on your > BlackBerry or iPhone. > _______________________________________________ > Tutor maillist - tu...@python.org > http://mail.python.org/mailman/listinfo/tutor > >
Sorry if I've sent this twice... Why would you want to do that? The closest you can get to that is using exec, but exec is usually considered a code smell. I'd say you're trying to do the wrong thing. -- Rich "Roadie Rich" Lovely There are 10 types of people in the world: those who know binary, those who do not, and those who are off by one. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor