Inspect Module in Python to Read Python Source Code

  Рет қаралды 772

Computing For All

Computing For All

Күн бұрын

Did you know about the inspect module in Python? Today, we're looking into the Python's inspect module. The inspect module in Python provides a wide range of functionalities for the introspection of live objects, including but not limited to Functions, Classes, Modules, and Method and Function Signatures. For example, let us say that from my program I want to see the code for Kmeans in sci-kit-learn.
We can use the getsource function of inspect to print the Kmeans code.
Unfortunately, we cannot view the source code of numpy.exp. But why is that? The video answers that!
Thank you for watching!
Dr. Shahriar Hossain
computing4all.com

Пікірлер: 2
@srinathmp4773
@srinathmp4773 4 ай бұрын
Nice, been using it lately, very useful!!
@C4A
@C4A 4 ай бұрын
That is great! Thank you for watching and commenting. Have a wonderful weekend.
Understanding Python: Threading
23:26
Jake Callahan
Рет қаралды 1,8 М.
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 132 МЛН
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 1,9 МЛН
Don't Write Comments
5:55
CodeAesthetic
Рет қаралды 802 М.
Is C# better than Python?
10:47
Gavin Lon
Рет қаралды 12 М.
9 Tricks to Master Python PRINT Function!
5:34
Coding Together
Рет қаралды 253
Memoization: The TRUE Way To Optimize Your Code In Python
7:32
Python's enum - Start Building Enumerations
19:38
Real Python
Рет қаралды 3,2 М.
Inspect Module with Understanding Of Stack
18:48
QA Automation Alchemist
Рет қаралды 688
Enums in Python are SO useful
5:39
Carberra
Рет қаралды 34 М.
Supercharge Your C# Code: Integrating Python using Python.NET
14:02
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 132 МЛН