|
||||
|
Hi all, I have defined global variables that I *think* are passed to functions, but I'm running into a problem: ( code under cut....Collapse ) While debugging I get the following error while converting from Cylindrical to Spherical: Traceback (most recent call last): File "/home/dotplaid/PythonMyStuff/coordinate radius, theta, phi = spherical("cylindrical", radius, theta, height) File "/home/dotplaid/PythonMyStuff/coordinate phi = round(math.atan(radius/height),3) UnboundLocalError: local variable 'radius' referenced before assignment I presume that the error is thrown because I'm using the variable radius incorrectly, but I don't see how. I would really much rather not rename radius in order to use it, so I changed the order of use in the cylindrical and spherical functions thinking that I could use the radius that was passed in and then re-evaluate it. Any insights that don't involve creating temporary (local) variables are most appreciated. All the best, .plaid |
||||
|
|
