[Tutor] Accessing Variables
adam.jtm30 at gmail.com
Wed Oct 5 23:42:26 CEST 2005
What you can do is if ONE.py has a class with the variable a, in it, you can
pass the class instance (ie. self) and then you can call any function or get
any global class variable.
On 05/10/05, Matt Williams <matthew.williams at cancer.org.uk> wrote:
> Dear List,
> I'm trying to clarify something about accessing variables.
> If I have ONE.py file with some variable a, and ONE imports TWO, which
> has a variable b, can TWO access variable a (I don't think so, but I
> just thought I'd check).
> I guess the way round this is just to make some classes & objects, and
> then they can easily pass parameters to each other, but I just thought
> I'd check.
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor