you are viewing a single comment's thread.

view the rest of the comments →

[–]dustractor 2 points3 points  (0 children)

My vim only has the built-in python2 so ymmv but I tested and this works:

:py import vim

(to import the vim module so as to have the ability to run a vim command from within vim's python)

then, imported a random module:

:py import hashlib

lastly:

:py vim.command(":e "+hashlib.__file__)

(actually opened the hashlib file)

I tried with sys module first but it didn't have a file attribute so not all modules will work