Re: [Tutor] Beginner question (variables, namespaces...) (fwd)

2006-04-08 Thread Kent Johnson
From: Jesse [EMAIL PROTECTED] I tried redefining the higher-order variables as functions, but it didn't quite work. Here's a simplified example: var1 = 2 def timestwo(x): return x*2 var2 = timestwo(var1) print var1, var2 var1 = 3 print var1, var2 This results in the

Re: [Tutor] Beginner question (variables, namespaces...) (fwd)

2006-04-08 Thread Danny Yoo
I tried redefining the higher-order variables as functions, but it didn't quite work. Here's a simplified example: var1 = 2 def timestwo(x): return x*2 var2 = timestwo(var1) print var1, var2 var1 = 3 print var1, var2 Try: ## print 2, timestwo(2) print 3, timestwo(3) ##

Re: [Tutor] Beginner question (variables, namespaces...) (fwd)

2006-04-08 Thread Danny Yoo
..which is not what I'm aiming for. Maybe I'll have to follow Bob's advice and just store all of the variable assignments in a function, and then call the function every time I change one of the variables (based on user input). I could still leave the higher-order variables as functions

[Tutor] Beginner question (variables, namespaces...)

2006-04-07 Thread Jesse
Why is it that when one variable is assigned a value in terms of another variable, assigning a new value to the first doesn't change the value of the second? This is giving me a huge headache, since I have a bunch of variables defined in terms of one another, and I want to be able to dynamically

Re: [Tutor] Beginner question (variables, namespaces...)

2006-04-07 Thread Danny Yoo
On Fri, 7 Apr 2006, Jesse wrote: Why is it that when one variable is assigned a value in terms of another variable, assigning a new value to the first doesn't change the value of the second? Hi Jesse, If you have a variable that depends on the values of other parameters, that's just

Re: [Tutor] Beginner question (variables, namespaces...)

2006-04-07 Thread Bob Gailer
Jesse wrote: Why is it that when one variable is assigned a value in terms of another variable, assigning a new value to the first doesn't change the value of the second? This is giving me a huge headache, since I have a bunch of variables defined in terms of one another, and I want to be

Re: [Tutor] Beginner question (variables, namespaces...) (fwd)

2006-04-07 Thread Danny Yoo
-- Forwarded message -- Date: Fri, 7 Apr 2006 21:05:33 -0600 From: Jesse [EMAIL PROTECTED] To: Danny Yoo [EMAIL PROTECTED] Subject: Re: [Tutor] Beginner question (variables, namespaces...) I tried redefining the higher-order variables as functions, but it didn't quite work