Tools, FAQ, Tutorials:
Modules Are Objects Too
Are modules objects in Python?
✍: FYIcenter.com
Yes, all modules are objects of "module" type in Python?
You can verify this with the following Python code:
>>> import firstModule >>> type(firstModule) <class 'module'>
In other words, the "import firstModule" statement performed two activities:
Like any other types of objects, you can use the "dir()" to list its members:
>>> import firstModule >>> dir(firstModule) ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', 'Python Tutorials', '__package__', '__spec__', '1.00', 'firstClass', 'sayHello']
⇐ 'import' Module Loading Statement
2022-08-26, 1216🔥, 0💬
Popular Posts:
How to troubleshoot the Orderer peer? The Docker container terminated by itself. You can follow this...
How to access Query String parameters from "context.Request.Url.Que ry"object in Azure API Policy? Q...
How To Change Text Fonts for Some Parts of a Paragraph? If you want to change text fonts or colors f...
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements...
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value mul...