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, 1124🔥, 0💬
Popular Posts:
Where to find tutorials on EPUB file format? I want to know how to create EPUB books. Here is a larg...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
Where to find tutorials on EPUB file format? I want to know how to create EPUB books. Here is a larg...
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...
How to build a test service operation to dump everything from the "context.Request" object in the re...