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, ∼2115🔥, 0💬
Popular Posts:
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
Tools, FAQ, Tutorials: JSON Validator JSON-XML Converter XML-JSON Converter JSON FAQ/Tutorials Pytho...
How to start Visual Studio Command Prompt? I have Visual Studio 2017 Community version with Visual C...
What Is Azure API Management Service? Azure API Management as a turnkey solution for publishing APIs...
How to access URL template parameters from "context.Request.Matched Parameters"object in Azure API P...