Re: [Tutor] objects becoming pointers

2009-07-16 Thread Alan Gauld
chris Hynes cjhyne...@hotmail.com wrote 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 This is a common misapprehension by beginners. But let me ask you something. Since you will

Re: [Tutor] objects becoming pointers

2009-07-16 Thread chris Hynes
for your help. To: tutor@python.org From: alan.ga...@btinternet.com Date: Thu, 16 Jul 2009 19:25:51 +0100 Subject: Re: [Tutor] objects becoming pointers chris Hynes cjhyne...@hotmail.com wrote I want the user to input a name, say Chris. I know I can use the code: name=raw_input() I

Re: [Tutor] objects becoming pointers

2009-07-16 Thread Dave Angel
chris Hynes wrote: That's just it, you won't know in advance what names the user will type in. Maybe I mean to say dynamically create pointers. For instance, In the morning, I might be working with data regarding methanol and do several iterations and save those iterations in separate arrays

[Tutor] objects becoming pointers

2009-07-15 Thread chris Hynes
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

Re: [Tutor] objects becoming pointers

2009-07-15 Thread Rich Lovely
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

Re: [Tutor] objects becoming pointers

2009-07-15 Thread Kent Johnson
On Wed, Jul 15, 2009 at 11:19 AM, chris Hynescjhyne...@hotmail.com wrote: 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

Re: [Tutor] objects becoming pointers

2009-07-15 Thread bob gailer
Please always reply-all so a copy goes to the list. chris Hynes wrote: Ah, there you go, that's what I want to do, dynamically create variable names. Then I could interactively create as many arrays as I want to, say Chris1, Chris2, Chris3 and each of these would be different array with