NB question on global/local variables in functions
Wolfgang
wollez at gmx.net
Sat Jul 15 06:55:23 EDT 2006
Hi all,
I've started to write some functions but I have some problems with
common variables in that functions.
So I have some variables which should be accessible by all my functions
but not accessible by the rest of my code. How can I do this?
Thanks
Wolfgang
###function.py:
c1=123.0
c2=134.0
def fun(temp):
return temp+c1-c2
def fun1(temp):
return temp-c1
### caller.py
from function import *
print fun(10.0)
print c1
More information about the Python-list
mailing list