siri
siri

Reputation: 723

Access a variable in imported module in Python

I have three Python scripts: aaa.py, bbb.py and ccc.py.

bbb.py:

import aaa as a

ccc.py:

import bbb as b

Can I use variable a directly in ccc.py? Like a.hello?

Or can any one please tell me how to access it?

Upvotes: 0

Views: 79

Answers (1)

aIKid
aIKid

Reputation: 28252

The ansewr should be yes.

import bbb as b
hello = b.a.hello

Upvotes: 2

Related Questions