Re: [Tutor] from string to variable name

2006-10-05 Thread wesley chun
On 10/5/06, frank h. <[EMAIL PROTECTED]> wrote: > hello, i have a string variable that contains a name that I want to use as > a variablename setattr() won't work because that's only for objects which have attributes. you're talking about creating a (global or local) variable. i will also reco

[Tutor] from string to variable name

2006-10-05 Thread Jonathon Sisson
By "string variable that contains a name that I want to use as a variablename" do you mean something like this: myString = "rotationalSpeed" rotationalSpeed = 4500 ?? In Python a dictionary is an excellent solution to this problem. The only other way to accomplish this (to my knowledge) is in P

Re: [Tutor] from string to variable name

2006-10-05 Thread Luke Paireepinart
frank h. wrote: > hello, i have a string variable that contains a name that I want to > use as a variablename > putting aside questions of why I would like to do that - i this > possible at all? > > so I want to assign a value to a variable whos name is available only > as a string to me. > tha

[Tutor] from string to variable name

2006-10-05 Thread frank h.
hello, i have a string variable that  contains a name that I want to use as a variablenameputting aside questions of why I would like to do that - i this possible at all?so I want to assign a value to a variable whos name is available only as a string to me. that variable does not exist yet in the