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, 922👍, 0💬
Popular Posts:
How to create Hello-2.0.epub with WinRAR? I have all required files to create Hello-2.0.epub. To cre...
Where to find tutorials on API Management Services at Azure Portal? Here is a list of tutorials to a...
How to login to the Developer Portal internally by you as the publisher? Normally, the Developer Por...
Where Is the Submitted Form Data Stored in PHP? When a user submit a form on your Web server, user e...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...