Matt Wheeler wrote:
import importlib, os
importlib.import_module(os.path.split.__module__).__file__
'/Users/matt/.pyenv/versions/3.6.0/lib/python3.6/posixpath.py'
Or just look the module name up in sys.modules, if we know (as
we do here) that the module has already been imported.
--
Greg
--
On 06/06/2017 03:52 PM, Matt Wheeler wrote:
On Tue, 6 Jun 2017 at 11:20 Peter Otten <__pete...@web.de> wrote:
import os
inspect.getsourcefile(os.path.split)
'/usr/lib/python3.4/posixpath.py'
And so much more fun than scanning the documentation :)
Alternatively, without using inspect, we c
On Tue, 6 Jun 2017 at 11:20 Peter Otten <__pete...@web.de> wrote:
>
> >>> import os
> >>> inspect.getsourcefile(os.path.split)
> '/usr/lib/python3.4/posixpath.py'
>
> And so much more fun than scanning the documentation :)
>
Alternatively, without using inspect, we can get around `Object.__module
Friedrich Rentsch wrote:
> Hi all,
>
> Developing a project, I have portions that work and should be assembled
> into a final program. Some parts don't interconnect when they should,
> because of my lack of rigor in managing versions. So in order to get on,
> I should next tidy up the mess and th
Hi all,
Developing a project, I have portions that work and should be assembled
into a final program. Some parts don't interconnect when they should,
because of my lack of rigor in managing versions. So in order to get on,
I should next tidy up the mess and the way I can think of to do it is t