ok...for example foo.py
I get a NameError that my class is undefined
[inline]
me@me-ubuntu:~/Documents/py/cs$ python3 bar0.py
Traceback (most recent call last):
File "bar0.py", line 5, in <module>
x=Foo()
NameError: name 'Foo' is not defined
me@me-ubuntu:~/Documents/py/cs$
[/inline]
when I use
I get the expected print out of 'foo'
I find this very odd...
class Foo(): def __init__(self): print('foo')When I import it into bar.py with
import foo
I get a NameError that my class is undefined
[inline]
me@me-ubuntu:~/Documents/py/cs$ python3 bar0.py
Traceback (most recent call last):
File "bar0.py", line 5, in <module>
x=Foo()
NameError: name 'Foo' is not defined
me@me-ubuntu:~/Documents/py/cs$
[/inline]
when I use
from foo import *
I get the expected print out of 'foo'
I find this very odd...