I was just going through the inspect module docs.
What exactly is the difference between:
inspect.getfile()
and
inspect.getsourcefile()
I get exactly the same file path (of the module) for both.
getfile():
Return the name of the (text or binary) file in which an object was defined. This will fail with a TypeError if the object is a built-in module, class, or function.
getfile()
also returns pyc (compiled) files, where as getsourcefile()
will only return source files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With