My test sample:
└> cat hello.py
class Hello:
def hello(self):
print "hello"
└> python -c 'from hello import Hello; h= Hello(); h.hello()'
hello
└> python -c 'import hello; h= hello.Hello(); h.hello()'
hello
You should import OfficeLights as:you can choose either import mypackage.mymodule or from mypackage.mymodule import myclass
python -c 'from lighting import OfficeLights; lights = OfficeLights(); lights.flashPurple();'
My test sample:
└> cat hello.py
class Hello:
def hello(self):
print "hello"
└> python -c 'from hello import Hello; h= Hello(); h.hello()'
hello
You should import OfficeLights as:
python -c 'from lighting import OfficeLights; lights = OfficeLights(); lights.flashPurple();'
test sample:
└> cat hello.py
class Hello:
def hello(self):
print "hello"
└> python -c 'from hello import Hello; h= Hello(); h.hello()'
hello
└> python -c 'import hello; h= hello.Hello(); h.hello()'
hello
you can choose either import mypackage.mymodule or from mypackage.mymodule import myclass
python -c 'from lighting import OfficeLights; lights = OfficeLights(); lights.flashPurple();'
My test sample:
└> cat hello.py
class Hello:
def hello(self):
print "hello"
└> python -c 'from hello import Hello; h= Hello(); h.hello()'
hello
You should import OfficeLights as:
python -c 'from lighting import OfficeLights; lights = OfficeLights(); lights.flashPurple();'
default