Q. Consider the following package
music/ Top level package
|
|----__inti__.py
|----formats/ sub package for file format
| |
| |--- __inti__.py
| |---wavread.py
| |---wavwrite.py
|
|----effects/ sub package for sound effects
| |
| |--- __inti__.py
| |---echo.py
| |---surround.py
| |---reverse.py
|
|----filters/ sub package for filters
|
|--- __inti__.py
|---equlizer.py
|---vocoder.py
|---karaoke.py
Each of the above modules contain functions play(), writefile() and readfile().
(a) If the module wavwrite() is imported using command import music.formats.wavwrite. How will you invoke its writefile() function? Write command for it.
(b) If the module wavwrite() is imported using command from music.formats import wavwrite. How will you invoke its writefile() function? Write command for it.
Answer =
(a)
import music.formats.wavwrite
music.formats.wavwrite.writefile()
(b)
from music.formats import wavwrite
wavwrite.writefile()
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )