The Difference between Import and From??
akira.kiyomiya at autodesk.com
Tue Mar 14 22:30:29 CET 2000
Well, I have a simple question that I cannot wait to ask. So here you go.
It should be simple.
% cat small.py
x = 1
y = [1, 2]
>>> from small import x, y
>>> x = 42
>>> y = 42
>>> import small
1 # why? I tought it would be 42?
[42 ,2] # yeah, I thought so.
I have a feeling that I am confused of how Python imports a file. Maybe
the difference between import and from??
More information about the Python-list